Harden SSRF, XXE, and JWT verification (pen-test remediation)#320
Merged
Conversation
namedgraph
commented
Jul 11, 2026
Member
- URLValidator: block loopback (127.0.0.0/8, ::1) and wildcard (0.0.0.0, ::) addresses in addition to link-local/private, and check every resolved address to narrow the DNS-rebinding window (LNK-003/LNK-009). ALLOW_INTERNAL_URLS remains the development escape hatch. Extend URLValidatorTest.
- SecureXML: hardened parser factories. XSLTMasterUpdater parses with DTDs and external entities disabled; ldh:send-request (SendHTTPRequest) parses external responses with secure processing (entity-expansion capped) and external entities disabled (LNK-005 residual).
- Upgrade java-jwt 3.19.4 -> 4.5.2 on the OAuth2/OIDC verification path; adapt the one breaking call (IDTokenFilterBase TokenExpiredException now takes an Instant); add JWKS-based JWTVerifier tests.
- Document the pinned-truststore invariant behind the disabled hostname verifier on internal HTTP clients.
- URLValidator: block loopback (127.0.0.0/8, ::1) and wildcard (0.0.0.0, ::) addresses in addition to link-local/private, and check every resolved address to narrow the DNS-rebinding window (LNK-003/LNK-009). ALLOW_INTERNAL_URLS remains the development escape hatch. Extend URLValidatorTest. - SecureXML: hardened parser factories. XSLTMasterUpdater parses with DTDs and external entities disabled; ldh:send-request (SendHTTPRequest) parses external responses with secure processing (entity-expansion capped) and external entities disabled (LNK-005 residual). - Upgrade java-jwt 3.19.4 -> 4.5.2 on the OAuth2/OIDC verification path; adapt the one breaking call (IDTokenFilterBase TokenExpiredException now takes an Instant); add JWKS-based JWTVerifier tests. - Document the pinned-truststore invariant behind the disabled hostname verifier on internal HTTP clients. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The loopback block broke the HTTP test suite: it runs entirely on https://localhost:4443/, so every client-cert WebID is a localhost URI that WebIDFilter validates on each authenticated request. Blocking loopback turned those into InternalURLException -> 400 on every authenticated call. LDH dereferences its own documents/WebIDs on the same origin (loopback in local/test deployments), and the actual pen-test target (fuseki-admin:3030) is site-local and already blocked, so loopback blocking added little and fought the architecture. Keep the wildcard/any-local block and the all-addresses DNS-rebinding check; leave loopback reachable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.