fix(security): harden curl SSRF/TLS defaults and gate service-type catalog - #171
Open
nicdavidson wants to merge 2 commits into
Open
fix(security): harden curl SSRF/TLS defaults and gate service-type catalog#171nicdavidson wants to merge 2 commits into
nicdavidson wants to merge 2 commits into
Conversation
Do not follow HTTP redirects automatically in the curl wrapper. When a caller opts into following redirects, each hop is now validated before it is requested so a redirect cannot reach a private, loopback, or link-local host. Enable SSL peer and host verification by default. Only return the installed service type list from the API root to authenticated callers. The role-filtered service list is unchanged. Claude-Session: https://claude.ai/code/session_01Mbf33BMddwdar9WbjWJvgo
Pin curl to the resolved IP for each validated redirect hop so the address that was checked is the address connected to. This removes the gap where a hostname could be re-pointed between the check and the request. The hostname is kept for SNI and certificate verification. Keep SSL peer and host verification on by default. Document the per-request opt-out (CURLOPT_SSL_VERIFYPEER / CURLOPT_SSL_VERIFYHOST) so callers with self-signed or internal endpoints can override the default without a code change. Claude-Session: https://claude.ai/code/session_01Mbf33BMddwdar9WbjWJvgo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Curl.php shipped FOLLOWLOCATION=true, SSL_VERIFYPEER=false. Now FOLLOWLOCATION=false, MAXREDIRS=0, VERIFYPEER=true, VERIFYHOST=2; redirects followed manually with per-hop SsrfValidator + DNS-pin via CURLOPT_RESOLVE. GET /api/v2/ catalog now gated behind isAuthenticated() (login UI unaffected). SHIP-TOGETHER: imports df-system SsrfValidator (on df-system develop) -> merge in the same release train or the redirect path fatals. Cherry-picked clean off acp/integration.
Validated during 2026-08-25 pentest handoff. Details + follow-ups: df-pentest-7.7/HANDOFF-KEVIN-CODY.md
https://claude.ai/code/session_01Mbf33BMddwdar9WbjWJvgo