Harden DCR resolver against SSRF when operator trust boundary changes
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
Context
Raised by code review on #5042 (comment).
DCRUpstreamConfig.DiscoveryURL and DCRUpstreamConfig.RegistrationEndpoint are operator-supplied URLs validated only for HTTPS-or-loopback. There is no allowlist or RFC1918 / link-local / metadata-service guard. The resolveDCRCredentials resolver issues outbound requests to whatever the operator configures — possibly with the RFC 7591 initial access token attached.
Today the operator role is fully trusted, so this is acceptable. The runtime trust assumption is now documented on DCRUpstreamConfig itself (see pkg/authserver/config.go).
When this becomes a problem
If the trust boundary ever changes — e.g.:
- A multi-tenant operator deployment where a tenant role can populate
DCRConfig. - Federated CRD authoring across less-trusted namespaces.
- A future surface that lets less-privileged roles supply DCR fields.
…then the resolver becomes a confused-deputy: an attacker who can write to the field can coerce the authserver into making outbound requests to internal addresses (cloud-provider metadata services, RFC1918 ranges, link-local 169.254.169.254, etc.), with the bearer token attached.
Hardening options
- Block RFC1918 / loopback (when not explicitly opted in) / link-local / cloud metadata addresses at validation time.
pkg/networking.IsPrivateIPalready exists. - Operator-level allowlist of permitted DCR hosts.
- Egress-controller / network-policy approach (out-of-process).
Acceptance
- DCR resolver rejects URLs resolving to private / link-local / metadata-service addresses unless explicit opt-in.
- Loopback-for-development carve-out preserved (existing behavior).
- Documented in
DCRUpstreamConfigdoc comment, replacing the trust-assumption note.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with resolveDCRCredentials and the DCRUpstreamConfig definition in pkg/authserver/config.go, then inspect pkg/networking.IsPrivateIP. Compare the existing HTTPS-or-loopback validation with the acceptance criteria and determine how private, link-local, and metadata addresses should be handled while preserving the development carve-out. Done means the resolver enforces the selected protection and the DCRUpstreamConfig comment documents the updated trust boundary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, networking, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100