Skip to content

Silent failure in http_cors.yaml due to unvalidated regex logic #1374

@jess-tech-lab

Description

@jess-tech-lab

Summary

There is a "silent failure" where the http_cors.yaml module fails to detect vulnerabilities due to an incorrect regex pattern with a trailing space. Currently, the test suite (tests/test_yaml_regexes.py) only checks if a regex is syntactically valid, not if it actually matches the expected data.

As a result, http_cors.yaml passes all tests despite being logically broken for real-world scanning.

Description

In nettacker/modules/vuln/http_cors.yaml, the regex (http|https):\\/\\/evil.com contains a trailing space.

Access-Control-Allow-Origin:
regex: "(http|https):\\/\\/evil.com "

  • Expected behavior: Match https://evil.com
  • Actual behavior: Fails to match because servers do not append a space to the Access-Control-Allow-Origin header.

Testing gap: The current tests/test_yaml_regexes.py sees this as a valid regex string and passes it, even though it will never trigger a "Detected" status in a real scan.

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