fix: [BUG] Authenticated scanning starts executing templates before th#7052
fix: [BUG] Authenticated scanning starts executing templates before th#7052SolariSystems wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
…he secret-file template finishes Addresses projectdiscovery#6592 Signed-off-by: Mark Brush <solarisys2025@gmail.com>
Neo - PR Security ReviewNo security issues found Highlights
Hardening Notes
Comment |
WalkthroughChanges modify the secret pre-fetching logic across two files to trigger when either PreFetchSecrets is enabled OR a SecretsFile is provided. Additionally, adds synchronization to ensure self-contained templates complete before target-bound templates execute, preventing premature template execution before authentication completes. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Runner as Runner/Core
participant Auth as Auth Template<br/>(Secret File)
participant Templates as Target Templates
Note over Client,Templates: Before Fix: Auth not guaranteed to complete first
Client->>Runner: Start scan with secret-file
Runner->>Auth: Prefetch auth (only if PreFetchSecrets=true)
Runner->>Templates: Execute templates (may start concurrently)
Auth->>Auth: Processing secret file...
Templates->>Templates: Requests sent unauthenticated
Note over Client,Templates: After Fix: Auth completes before targets
Client->>Runner: Start scan with secret-file
Runner->>Auth: Prefetch auth (if PreFetchSecrets OR SecretsFile exists)
Auth->>Auth: Processing secret file...
Auth-->>Runner: Auth complete
Runner->>Templates: Wait for self-contained to finish
Templates->>Templates: Requests sent authenticated
Estimated code review effort🎯 2 (Simple) | ⏱️ ~14 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi, thanks for your interest in contributing! Just a heads up, we ask contributors to work on 1 active issue at a time (see). Also, we welcome AI-assisted development, but submissions must be complete, tested, and ready to merge. Please also make sure to fill out the PR template with proof that your changes work. We're closing this PR along with your other open submissions. Once you're ready, feel free to pick one issue to focus on and resubmit; we'd be happy to review it. Appreciate your understanding! |
Summary
Fixes #6592
Fix the race condition between self-contained templates (auth/secret-file) and regular templates by moving the WaitGroup synchronization point to before strategy execution, ensuring auth templates complete first. Also force prefetch when secret files are provided.
Changes Made
Pass 2 direct: Fix the race condition between self-contained templates (auth/secret-file) and regular templates by moving the WaitGroup synchronization point to before strategy execution, ensuring auth templates com
Verification
Summary by CodeRabbit
/claim #6592