Repository navigation
feat: AnarCry v2.2.0 - WAF stealth, cookie cache, UI fixes, scanner expansion - #36
Conversation
Semgrep Static Analysis
|
SpotBugs + FindSecBugs
✅ No high-priority issues. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 109 |
| Duplication | 8 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Security Scan Summary
✅ All security checks passed! |
…t, FP reduction New scanner modules: - CSRF detection (token validation, SameSite, referer bypass) - Secrets/credential discovery (17 patterns: AWS, GCP, GitHub, Slack, etc.) - Race condition scanner (concurrent request analysis, state inconsistency) - NoSQL injection (MongoDB operator injection, auth bypass) - Insecure deserialization (Java, PHP, Python, .NET gadget detection) - File upload bypass (extension, content-type, magic byte manipulation) - Subdomain takeover (dangling CNAME detection, service fingerprinting) - WebSocket security (origin validation, unauth endpoint detection) - Prototype pollution (__proto__, constructor.prototype injection) - Cloud misconfiguration (S3/Azure/GCS public access, metadata endpoint) OAST infrastructure: - OastServer with HTTP/DNS callback handling - OastCorrelator for blind vulnerability confirmation - Integrated into SSRF, XXE, SQLi, CmdInjection modules Module enhancements: - JWT++: x5c chain, x5u cert, key confusion (RS256->HS256) probes - GraphQL++: mutation testing, nested DoS, batching bypass, field suggestion leak - XXE++: SVG upload, SAML, XInclude, content-type switching - HTTP/2 Smuggling: H2.CL, H2.TE, header manipulation, CRLF injection SARIF v2.1.0 export with full CWE/CVSS mapping FP reduction: echo detection, module-specific validation hooks, structural HTML comparison, statistical timing analysis
…erals False positives -- the scanner intentionally references ws:// URIs to detect insecure WebSocket connections on targets.
There was a problem hiding this comment.
Pull Request Overview
This PR has blocking correctness and safety issues. The JWT x5c probe currently cannot compile, the CSRF module may perform destructive authenticated state changes, and the x5u probe can report vulnerabilities from generic errors or timing noise. The command-injection DNS OAST path is also nonfunctional because the payload and server do not support DNS callbacks.
The primary end-to-end acceptance paths remain unverified: OAST-backed scanner integration, SARIF schema compliance, JWT x5c execution, default module disablement, and false-positive reduction behavior lack the required tests. The complex report and TUI/module areas have no reported coverage data, increasing regression risk, though no additional agent finding targets those files.
About this PR
- Add automated integration coverage for newly registered scanner modules and the end-to-end OAST and SARIF flows before relying on this expansion.
Test suggestions
- Compile and execute the JWT x5c probe, including certificate generation and token signing.
- Verify OAST HTTP and DNS callbacks are accepted and correlated.
- Verify SSRF, XXE, SQLi, and command-injection modules register OAST payloads and produce correlated findings.
- Validate generated SARIF against the SARIF 2.1.0 schema, including rules, locations, levels, CWE, and CVSS properties.
- Verify RaceCondition and FileUpload are disabled by default in CLI, GUI, and TUI.
- Test module-aware baseline thresholds, structural HTML comparison, echo detection, and statistical timing behavior.
- Test OAST configuration, correlation, callback URL generation, and HTTP server behavior.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Compile and execute the JWT x5c probe, including certificate generation and token signing.
2. Verify OAST HTTP and DNS callbacks are accepted and correlated.
3. Verify SSRF, XXE, SQLi, and command-injection modules register OAST payloads and produce correlated findings.
4. Validate generated SARIF against the SARIF 2.1.0 schema, including rules, locations, levels, CWE, and CVSS properties.
5. Verify RaceCondition and FileUpload are disabled by default in CLI, GUI, and TUI.
6. Test module-aware baseline thresholds, structural HTML comparison, echo detection, and statistical timing behavior.
7. Test OAST configuration, correlation, callback URL generation, and HTTP server behavior.
Make this review better
TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.
TIP Add Codacy review.md instructions or an AGENTS.md so the reviewer knows your conventions.
TIP How was this review? Give us feedback
| || probeBody.contains("connect timed out") || probeBody.contains("ECONNREFUSED") | ||
| || probeBody.contains("connection_refused"); | ||
|
|
||
| if (accepted || serverError || timingAnomaly || connectionError) { |
There was a problem hiding this comment.
🔴 HIGH RISK
Require a controlled callback or a differential response specifically demonstrating x5u retrieval, rather than reporting solely from generic errors or timing changes.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
| String cbHost = cbBase.replaceFirst("^https?://", "").replaceFirst("/.*$", ""); | ||
|
|
||
| // curl-based callbacks (HTTP) | ||
| String[] separators = {"; ", "| ", "$("}; | ||
| String[] suffixes = {"", "", ")"}; | ||
| for (int i = 0; i < separators.length; i++) { | ||
| String payloadId = OastCorrelator.generatePayloadId(); | ||
| String curlUrl = oast.callbackUrl(payloadId); | ||
| String payload = "testvalue" + separators[i] + "curl " + curlUrl + suffixes[i]; | ||
| injectSingleOob(ctx, hc, oast, base, path, param, payloadId, payload, "curl-" + i, log); | ||
| } | ||
|
|
||
| // nslookup-based callback (DNS) | ||
| String dnsId = OastCorrelator.generatePayloadId(); | ||
| String dnsPayload = "testvalue; nslookup " + dnsId + "." + cbHost; | ||
| injectSingleOob(ctx, hc, oast, base, path, param, dnsId, dnsPayload, "nslookup", log); |
There was a problem hiding this comment.
🔴 HIGH RISK
Use only the callback hostname in DNS payloads, retain the port for HTTP URLs, and implement a DNS listener/correlation path or remove DNS callback claims.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
| String actionUrl = resolveUrl(baseUrl, form.action()); | ||
|
|
||
| // Get baseline: submit with valid token | ||
| int baselineStatus = submitForm(ctx, hc, actionUrl, form.tokenName(), form.tokenValue()); |
There was a problem hiding this comment.
🔴 HIGH RISK
Use a non-destructive validation approach, or require an explicit opt-in/sandbox target before sending state-changing authenticated requests.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
| import org.bouncycastle.asn1.x509.Time; | ||
| import org.bouncycastle.asn1.x509.V3TBSCertificateGenerator; |
There was a problem hiding this comment.
🔴 HIGH RISK
Replace the invalid placeholder import with the intended Bouncy Castle type and add the required Time import used by the certificate construction.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
|
|
||
| String encoded = URLEncoder.encode(param + op.suffix(), "UTF-8"); | ||
| // Operator payloads use the param[$op]=value format | ||
| String url = base + path + "?" + param + URLEncoder.encode(op.suffix(), "UTF-8"); |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Encode the parameter name and operator value separately while preserving the bracket syntax, such as param + "[$ne]=" + encodedValue.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
7c03bef to
6ad5fa7
Compare
SpotBugs + FindSecBugs
✅ No high-priority issues. |
Semgrep Static Analysis
|
Security Scan Summary
✅ All security checks passed! |
… relocation - PlaywrightStealth: anti-detection scripts for headless Chromium (navigator.webdriver removal, chrome runtime stub, plugins/languages spoofing, WebGL vendor override, connection RTT) - ChallengeSolver: stealth context, viewport 1920x1080, increased Vercel timeout to 60s, click verification elements, waitForFunction polling - BrowserTransport: stealth scripts + proper context options - CookieCache: persist challenge cookies to ~/.anarcry/cookies.json (2h TTL), loaded before ChallengeSolver to skip redundant solves - WafState: global wafDelayMs throttle (+300ms/req when WAF active without clearance cookies) - Http.send: applies wafDelayMs on top of config delay - LogPane: DefaultCaret.NEVER_UPDATE fixes auto-scroll pulling user back to bottom while reading logs during scan - Debug toggle moved from ModulesPanel to LogPane/LogPanel (floating 28x28 bug icon in log area corner) - LogPane: isOptimizedDrawingEnabled=false fixes debug icon drift on scroll - Smart auto-scroll in both GUI (isScrolledToBottom check) and TUI (wasAtBottom pattern already present)
Semgrep Static Analysis
|
SpotBugs + FindSecBugs
✅ No high-priority issues. |
Security Scan Summary
✅ All security checks passed! |
Summary
Major scanner expansion adding 13 new vulnerability detection modules, out-of-band testing infrastructure, SARIF export, false positive reduction, WAF bypass improvements, and UI fixes.
New Scanner Modules
JWT++ Probes
OAST Infrastructure
Module Enhancements
WAF Bypass and Stealth
UI Improvements
Other
Test Plan