Skip to content

Major vhost (virtualhost) rewrite#2672

Draft
liquidsec wants to merge 172 commits intoasn-as-targetsfrom
virtualhost-upgrade
Draft

Major vhost (virtualhost) rewrite#2672
liquidsec wants to merge 172 commits intoasn-as-targetsfrom
virtualhost-upgrade

Conversation

@liquidsec
Copy link
Collaborator

No description provided.

@liquidsec liquidsec marked this pull request as draft September 3, 2025 17:05
assert canary_subdomain.endswith(".example.com"), (
f"Subdomain canary doesn't end with basehost: {canary_subdomain}"
)
assert "-test.example.com" in canary_mutation, (

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization

The string [-test.example.com](1) may be at an arbitrary position in the sanitized URL.

Copilot Autofix

AI 5 months ago

The fix is to replace the substring check " -test.example.com" in canary_mutation with a more precise hostname validation. Since canary_mutation is intended as a hostname or domain, and we want to ensure it correctly ends with -test.example.com rather than appearing at any arbitrary position, we should parse (or treat) it as a domain name and use the .endswith() method. This would check that canary_mutation is a domain with the required suffix, so only validly-structured canary hosts would pass the test.

The change should occur in bbot/test/test_step_2/module_tests/test_module_virtualhost.py, around line 470, inside the check method of TestVirtualhostHTTPSLogic. No additional imports are needed, as string logic is sufficient here.

Suggested changeset 1
bbot/test/test_step_2/module_tests/test_module_virtualhost.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/bbot/test/test_step_2/module_tests/test_module_virtualhost.py b/bbot/test/test_step_2/module_tests/test_module_virtualhost.py
--- a/bbot/test/test_step_2/module_tests/test_module_virtualhost.py
+++ b/bbot/test/test_step_2/module_tests/test_module_virtualhost.py
@@ -467,8 +467,8 @@
         assert canary_subdomain.endswith(".example.com"), (
             f"Subdomain canary doesn't end with basehost: {canary_subdomain}"
         )
-        assert "-test.example.com" in canary_mutation, (
-            f"Mutation canary doesn't contain expected pattern: {canary_mutation}"
+        assert canary_mutation.endswith("-test.example.com"), (
+            f"Mutation canary doesn't end with expected pattern: {canary_mutation}"
         )
         assert canary_random.endswith(".com"), f"Random canary doesn't end with .com: {canary_random}"
 
EOF
@@ -467,8 +467,8 @@
assert canary_subdomain.endswith(".example.com"), (
f"Subdomain canary doesn't end with basehost: {canary_subdomain}"
)
assert "-test.example.com" in canary_mutation, (
f"Mutation canary doesn't contain expected pattern: {canary_mutation}"
assert canary_mutation.endswith("-test.example.com"), (
f"Mutation canary doesn't end with expected pattern: {canary_mutation}"
)
assert canary_random.endswith(".com"), f"Random canary doesn't end with .com: {canary_random}"

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@liquidsec liquidsec force-pushed the asn-as-targets branch 2 times, most recently from a65a347 to 344130e Compare February 28, 2026 01:00
Resolve conflicts taking asn-as-targets as source of truth.
Move bake()+init into Scanner.__init__ (sync bake).
Convert generic_ssrf from VULNERABILITY to FINDING event type.
Fix virtualhost test to check FINDING instead of VULNERABILITY.
Keep generic_ssrf module (deleted on asn-as-targets, restored here).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants