Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(coderd): harden Azure identity certificate fetch (cherry-pick v2.30) - #25281

Merged
jdomeracki-coder merged 1 commit into
release/2.30from
cherry-pick/harden-azure-identity-2.30
May 13, 2026
Merged

jdomeracki-coder merged 1 commit into
release/2.30from
cherry-pick/harden-azure-identity-2.30

Conversation

@jdomeracki-coder

Copy link
Copy Markdown
Contributor

Cherry-pick of 57b11d4 to release/2.30.

Backport of #25274.

Note

This PR was created by Coder Agents on behalf of a human.

Security improvements:
- Restrict cert fetches to a host+port allowlist (Microsoft and DigiCert
on 80/443).
- Route requests through a dedicated `http.Client` that resolves the
host once and dials the validated IP directly, preventing DNS rebinding.
- Reject loopback, private (RFC 1918 / IPv6 ULA), link-local, multicast,
unspecified, CGNAT, benchmarking, and IPv4-mapped IPv6 addresses.
- Cap the certificate response body at 1 MiB.
- Log the underlying error via slog and return a generic detail to the
caller to prevent information disclosure.

(cherry picked from commit 57b11d4)
@jdomeracki-coder jdomeracki-coder added the cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch label May 13, 2026
@coderagents

coderagents Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

No Changes Needed

This is a security hardening backport (cherry-pick of #25274 to release/2.30) that fixes SSRF vulnerabilities in the Azure identity certificate fetch path. The changes are entirely internal:

  • Added an allowlist of permitted certificate hosts (microsoft.com, digicert.com)
  • Added an HTTP client that rejects private/reserved IP connections
  • Added a 1 MiB cap on certificate response bodies
  • Improved error messages to avoid information disclosure

No new CLI flags, environment variables, configuration options, or API contract changes were introduced. The existing /api/v2/workspaceagents/azure-instance-identity endpoint behavior is unchanged from a user perspective.


Automated review via Coder Tasks

@jdomeracki-coder
jdomeracki-coder merged commit af737be into release/2.30 May 13, 2026
50 of 53 checks passed
@jdomeracki-coder
jdomeracki-coder deleted the cherry-pick/harden-azure-identity-2.30 branch May 13, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants