Skip to content

Conversation

@jnunemaker
Copy link
Owner

When base_uri is configured and a path argument contains an absolute URL with a different host, HTTParty now raises UnsafeURIError instead of sending the request (and any configured headers/credentials) to the unintended host.

This prevents Server-Side Request Forgery (SSRF) attacks where an attacker controlling the path value could redirect requests to malicious servers and capture API keys or other sensitive headers.

The validation can be bypassed with skip_uri_validation: true for legitimate use cases. Redirects are not validated to allow normal redirect flows.

🤖 Generated with Claude Code

…-38w4)

When base_uri is configured and a path argument contains an absolute URL
with a different host, HTTParty now raises UnsafeURIError instead of
sending the request (and any configured headers/credentials) to the
unintended host.

This prevents Server-Side Request Forgery (SSRF) attacks where an attacker
controlling the path value could redirect requests to malicious servers
and capture API keys or other sensitive headers.

The validation can be bypassed with `skip_uri_validation: true` for
legitimate use cases. Redirects are not validated to allow normal
redirect flows.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jnunemaker jnunemaker self-assigned this Dec 23, 2025
@jnunemaker jnunemaker merged commit ddfbc8d into main Dec 23, 2025
12 checks passed
@ashkulz ashkulz mentioned this pull request Dec 24, 2025
@ienev
Copy link

ienev commented Jan 6, 2026

Not sure if anyone has already raised this but this PR still doesn't fix the PoC given here GHSA-hm5p-x4rq-38w4

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.

3 participants