Skip to content

🔒 Fix SSRF vulnerability in RestClient host configuration#48

Merged
rustyy merged 2 commits into
developmentfrom
fix/rest-client-ssrf-3027409861171783670
Jun 21, 2026
Merged

🔒 Fix SSRF vulnerability in RestClient host configuration#48
rustyy merged 2 commits into
developmentfrom
fix/rest-client-ssrf-3027409861171783670

Conversation

@rustyy

@rustyy rustyy commented Jun 20, 2026

Copy link
Copy Markdown
Owner

🎯 What: Validates the opts.host configuration provided to the RestClient using the built-in URL class.

⚠️ Risk: The previous "${string}" union type allowed for any arbitrary string to be passed into the API calls, potentially allowing a malicious user/configuration to cause an SSRF (Server-Side Request Forgery) by interacting with unintended internal resources or external sites through the SDK's host argument.

🛡️ Solution: The change introduces a try/catch block that parses the host through new URL(opts.host). It will now throw an Error and block the execution if the given host does not evaluate to a valid URL structure. Tests were also added ensuring correct functionality.


PR created automatically by Jules for task 3027409861171783670 started by @rustyy

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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.

@rustyy rustyy force-pushed the fix/rest-client-ssrf-3027409861171783670 branch from aabf3a3 to 13c44f6 Compare June 20, 2026 19:10
@rustyy rustyy changed the base branch from main to development June 20, 2026 19:10
@rustyy rustyy force-pushed the fix/rest-client-ssrf-3027409861171783670 branch from 1e8d399 to aa20f53 Compare June 21, 2026 19:36
@rustyy rustyy merged commit 4239d9f into development Jun 21, 2026
2 checks passed
@rustyy rustyy deleted the fix/rest-client-ssrf-3027409861171783670 branch June 21, 2026 19:37
@sonarqubecloud

Copy link
Copy Markdown

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