/

CVE-2026-111927

Severity:

HIGH RISK

(7.7)

Improper Hostname Validation (CWE-522) in Coder Platform

CVE-2026-111927

Awaiting Analysis

Vulnerability type

Category:

Improper Hostname Validation

CWE:

CWE-522

Impact:

Credential Exposure and Unauthorized Workspace Application Access

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Coder contains an improper hostname validation flaw that can cause a domain resembling a trusted workspace-proxy hostname to be accepted as legitimate. An attacker controlling such a domain may trick an authenticated user into opening a crafted redirect link, capture an application connection API key, and replay it to access the user's workspace applications.

Coder contains an improper hostname validation flaw that can cause a domain resembling a trusted workspace-proxy hostname to be accepted as legitimate. An attacker controlling such a domain may trick an authenticated user into opening a crafted redirect link, capture an application connection API key, and replay it to access the user's workspace applications.

Affected context

The issue occurs in Coder deployments that use workspace proxies and process application authentication redirects through hostname-based proxy lookup. Risk arises when hostname matching treats a string prefix as equivalent to a complete, valid hostname, allowing an attacker-controlled domain to be trusted as a workspace-proxy access URL. Exploitation also depends on an authenticated victim following a crafted link.

The issue occurs in Coder deployments that use workspace proxies and process application authentication redirects through hostname-based proxy lookup. Risk arises when hostname matching treats a string prefix as equivalent to a complete, valid hostname, allowing an attacker-controlled domain to be trusted as a workspace-proxy access URL. Exploitation also depends on an authenticated victim following a crafted link.

Exploit preconditions

  • Attack surface: Workspace application authentication and proxy resolution endpoints
  • Required access: Control of a domain that begins with a trusted workspace-proxy hostname, plus the ability to lure an authenticated user to a crafted link
  • Trigger point: Processing of an /api/v2/applications/auth-redirect request
  • Why exploitation is possible: Prefix-based hostname matching can trust attacker-controlled domains, allowing an application connection API key to be redirected to and captured by the attacker
  • Attack surface: Workspace application authentication and proxy resolution endpoints
  • Required access: Control of a domain that begins with a trusted workspace-proxy hostname, plus the ability to lure an authenticated user to a crafted link
  • Trigger point: Processing of an /api/v2/applications/auth-redirect request
  • Why exploitation is possible: Prefix-based hostname matching can trust attacker-controlled domains, allowing an application connection API key to be redirected to and captured by the attacker

Why this happens

The underlying bug is an improper hostname validation pattern in which a SQL SIMILAR TO expression performs a prefix match rather than enforcing an exact hostname or properly delimited domain relationship. This causes a domain that merely begins with a trusted workspace-proxy access URL to be treated as trusted. The resulting trust-boundary failure can expose authentication material and maps to CWE-522, which covers insufficient protection of credentials.

The underlying bug is an improper hostname validation pattern in which a SQL SIMILAR TO expression performs a prefix match rather than enforcing an exact hostname or properly delimited domain relationship. This causes a domain that merely begins with a trusted workspace-proxy access URL to be treated as trusted. The resulting trust-boundary failure can expose authentication material and maps to CWE-522, which covers insufficient protection of credentials.

Potential impact

  • An attacker may capture an application connection API key
  • The captured key could be replayed to access the victim's workspace applications
  • Unauthorized users may gain access to application data or actions available through the affected workspace
  • A successful attack could expose credentials beyond the originally intended redirect context
  • An attacker may capture an application connection API key
  • The captured key could be replayed to access the victim's workspace applications
  • Unauthorized users may gain access to application data or actions available through the affected workspace
  • A successful attack could expose credentials beyond the originally intended redirect context

General mitigation guidance

Mitigation generally focuses on making hostname trust decisions exact, canonical, and resistant to ambiguous parsing.

Common defensive patterns include:

  • Requiring exact hostname matches or explicitly delimited subdomain relationships
  • Avoiding prefix-only comparisons for security-sensitive host validation
  • Canonicalizing hostnames consistently before comparison
  • Restricting redirect destinations to an explicit allowlist
  • Limiting the scope, lifetime, and privileges of application connection credentials
  • Avoiding placement of sensitive tokens in redirect flows where attacker-controlled destinations may be reached
  • Applying least privilege to workspace application access and requiring additional authorization for high-impact operations

Mitigation generally focuses on making hostname trust decisions exact, canonical, and resistant to ambiguous parsing.

Common defensive patterns include:

  • Requiring exact hostname matches or explicitly delimited subdomain relationships
  • Avoiding prefix-only comparisons for security-sensitive host validation
  • Canonicalizing hostnames consistently before comparison
  • Restricting redirect destinations to an explicit allowlist
  • Limiting the scope, lifetime, and privileges of application connection credentials
  • Avoiding placement of sensitive tokens in redirect flows where attacker-controlled destinations may be reached
  • Applying least privilege to workspace application access and requiring additional authorization for high-impact operations

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review rules targeting prefix-based hostname comparisons
  • Review of SQL LIKE or SIMILAR TO expressions used in authorization and proxy-selection logic
  • Tests covering attacker-controlled domains that share a trusted hostname prefix
  • Policy checks requiring canonicalization and exact allowlist validation for redirect destinations
  • Monitoring for unusual application authentication redirects, API key reuse, and access from domains outside approved proxy boundaries

Automated security review tools may help identify unsafe comparison patterns, but behavioral tests should verify the complete trust decision.

Organizations can look for this class of issue through:

  • Static analysis and code review rules targeting prefix-based hostname comparisons
  • Review of SQL LIKE or SIMILAR TO expressions used in authorization and proxy-selection logic
  • Tests covering attacker-controlled domains that share a trusted hostname prefix
  • Policy checks requiring canonicalization and exact allowlist validation for redirect destinations
  • Monitoring for unusual application authentication redirects, API key reuse, and access from domains outside approved proxy boundaries

Automated security review tools may help identify unsafe comparison patterns, but behavioral tests should verify the complete trust decision.

Sources

SourceLink
github.comgithub.com/coder/coder/security/advisories/GHSA-h58h-qvv5-xvwg
vulncheck.comvulncheck.com/advisories/coder-before-2.35.4-credential-theft-via-workspace-proxy-hostname-prefix-match

Frequently asked

questions

Yes, exploitation can occur through a crafted web link, but it generally requires an attacker-controlled domain and an authenticated victim who follows the link.

The attacker needs to control a domain that satisfies the flawed prefix-based hostname check. They also need to induce an authenticated user to access the crafted application redirect.

Replace prefix-only hostname validation with canonicalized, exact allowlist checks that clearly distinguish complete hostnames from attacker-controlled lookalikes. Redirect destinations and credential exposure should also be tightly constrained.

Treat hostnames and redirect targets as security-sensitive inputs, test boundary cases involving lookalike domains, minimize token scope and lifetime, and enforce least-privilege access for workspace applications.

Yes, exploitation can occur through a crafted web link, but it generally requires an attacker-controlled domain and an authenticated victim who follows the link.

The attacker needs to control a domain that satisfies the flawed prefix-based hostname check. They also need to induce an authenticated user to access the crafted application redirect.

Replace prefix-only hostname validation with canonicalized, exact allowlist checks that clearly distinguish complete hostnames from attacker-controlled lookalikes. Redirect destinations and credential exposure should also be tightly constrained.

Treat hostnames and redirect targets as security-sensitive inputs, test boundary cases involving lookalike domains, minimize token scope and lifetime, and enforce least-privilege access for workspace applications.

Find out what's already
exploitable in your codebase.