Skip to content

Feat: Auto-generate security regression tests for verified vulnerabilities #41

Open

Description

@officialfrancismendoza

Summary

Extend OpenHack's existing vulnerability discovery, verification, and remediation pipeline to automatically generate permanent security regression tests. This is to ensure that vulnerabilities discovered and fixed by OpenHack cannot silently reappear following future code changes.

Proposed Feature

When OpenHack verifies a vulnerability, it should:

  1. Identify the security invariant being violated (e.g., users must not access another user's private resources).
  2. Generate an executable regression test using the repository's existing testing framework.
  3. Validate the test by confirming it fails against vulnerable code and passes against the patched implementation.
  4. Include the test in the remediation PR, allowing it to run automatically in CI/CD.
  5. Optionally generate broader invariant tests to prevent related vulnerabilities, not just the original exploit.

Example

  1. OpenHack discovers an IDOR vulnerability allowing User A to access User B's documents.
  2. After remediation, OpenHack automatically adds a test verifying that cross-user document access is denied.
  3. If a future refactor accidentally removes the authorization check, CI catches the regression before deployment.

Acceptance Criteria

  • Generate executable tests from verified vulnerabilities.
  • Support existing repository testing frameworks.
  • Verify tests fail before remediation and pass afterward.
  • Include generated tests in remediation PRs.
  • Ensure tests run independently without additional LLM inference.
  • Make regression test generation configurable.

Value

Transforms OpenHack from a tool that discovers and fixes vulnerabilities into one that continuously prevents previously discovered security failures from recurring, while reducing the need for repeated AI-powered scans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions