Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in website analysis and document processing - #404

Open
criptogus wants to merge 1 commit into
mainfrom
sentinel/fix-ssrf-redirects-18376192908279637184
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF vulnerability in website analysis and document processing#404
criptogus wants to merge 1 commit into
mainfrom
sentinel/fix-ssrf-redirects-18376192908279637184

Conversation

@criptogus

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Server-Side Request Forgery (SSRF) bypass via redirects. The validateWebUrl function checked the initial URL, but axios followed redirects automatically, potentially exposing private internal services (e.g. metadata services) if the target server redirected to a private IP.
🎯 Impact: Attackers could access internal services, read metadata, or perform port scanning on the internal network by supplying a malicious URL that redirects to internal IPs.
πŸ”§ Fix:

  • Enhanced backend/src/utils/ssrf-filter.ts to include getSafeHttpAgent and getSafeHttpsAgent.
  • These agents use a custom DNS lookup that validates the IP address against private ranges before connection, preventing DNS rebinding and ensuring redirects are also checked.
  • Updated WebsiteAnalysisService and DocumentSourceProcessorService to use these safe agents.
    βœ… Verification:
  • Added backend/src/utils/ssrf-filter.test.ts to verify IP blocking logic.
  • Ran tests with npx jest.

PR created automatically by Jules for task 18376192908279637184 started by @criptogus

…cument processing

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Server-Side Request Forgery (SSRF) bypass via redirects. The `validateWebUrl` function checked the initial URL, but `axios` followed redirects automatically, potentially exposing private internal services.
🎯 Impact: Attackers could access internal services or read metadata by supplying a malicious URL that redirects to internal IPs.
πŸ”§ Fix: Implemented safe HTTP/HTTPS agents with custom DNS lookup validation to prevent SSRF and DNS rebinding. Applied to `WebsiteAnalysisService` and `DocumentSourceProcessorService`.
βœ… Verification: Added unit tests for IP blocking logic.

Co-authored-by: criptogus <128640021+criptogus@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

1 participant