Skip to content

fix(security): harden curl SSRF/TLS defaults and gate service-type catalog - #171

Open
nicdavidson wants to merge 2 commits into
developfrom
security/curl-ssrf-clean
Open

fix(security): harden curl SSRF/TLS defaults and gate service-type catalog#171
nicdavidson wants to merge 2 commits into
developfrom
security/curl-ssrf-clean

Conversation

@nicdavidson

Copy link
Copy Markdown
Contributor

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

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