{
  "id": "teamcity-agent-registration",
  "url": "https://ohshit.app/incidents/teamcity-agent-registration/",
  "title": "TeamCity agent-registration bypass exposes build secrets; watchTowr reports attack attempts",
  "level": 4,
  "level_name": "septic-tank-blew",
  "date": "2026-12-02",
  "date_is_approximate": false,
  "updated": null,
  "tags": [
    "TeamCity",
    "CI/CD",
    "authentication bypass"
  ],
  "ecosystems": [],
  "summary": "CVE-2026-136858 lets an unauthenticated attacker impersonate an authorized TeamCity agent and intercept builds or alter artifacts. watchTowr reports December 3 honeypot attempts; upgrade to 2026.1.7, 2026.2.3 or 2026.3, or verify the issue-specific patch plugin.",
  "splash": "Unpatched TeamCity On-Premises reachable over HTTP(S); attackers must guess a valid agent ID. TeamCity Cloud is already corrected.",
  "wipe": "Upgrade or verify the security patch plugin; preserve logs, investigate non-empty token mismatches and rotate exposed build secrets.",
  "in_the_wild": "yes",
  "source_exception": null,
  "cves": [
    {
      "id": "CVE-2026-136858",
      "score": 9.1,
      "name": "Authorized build-agent impersonation",
      "description": "Unauthenticated agent-registration bypass can displace an agent, expose build secrets and tamper with build results or artifacts."
    }
  ],
  "fixed": [
    {
      "product": "TeamCity 2026.1",
      "branch": "2026.1",
      "version": "2026.1.7",
      "status": "Fixed"
    },
    {
      "product": "TeamCity 2026.2",
      "branch": "2026.2",
      "version": "2026.2.3",
      "status": "Fixed"
    },
    {
      "product": "TeamCity 2026.3",
      "version": "2026.3",
      "status": "Fixed; vendor release name"
    },
    {
      "product": "Older TeamCity On-Premises releases",
      "version": "none",
      "status": "Upgrade; issue-specific patch plugin available for 2021.2 and later"
    }
  ],
  "checklist": [
    {
      "title": "Update each server or verify the issue-specific patch",
      "hint": "Upgrade to JetBrains releases 2026.1.7, 2026.2.3 or 2026.3. If unable to upgrade, use the official security patch plugin for TeamCity 2021.2 and later; it needs no server restart and fixes this CVE only. Older releases outside plugin coverage must upgrade. TeamCity Cloud customers need no action for this issue."
    },
    {
      "title": "Check patch installation rather than assuming automatic protection",
      "hint": "In Administration > Updates, versions 2024.03–2026.2.1 require reviewing/applying Available security updates. On 2026.2.2 and later, Security patches > Install automatically enables verified compatible automatic installation; Download and notify still requires applying the downloaded patch. Ignore requires manual review/install. For other plugin-supported versions, use JetBrains’ manual download/install link in the advisory."
    },
    {
      "title": "Preserve logs and investigate non-empty token mismatches",
      "hint": "Search teamcity-server.log for: of the existing agent, but different authorization token \"<token>\". A non-empty token may signal takeover attempts; empty \"\" tokens are expected for this check. Match timestamps to agent connection history, hostname and source IP, then compare assigned builds, build logs, results and published artifacts. A matching line alone does not prove successful compromise."
    },
    {
      "title": "Contain suspected build-secret and artifact exposure",
      "hint": "Preserve relevant logs/results, patch the server and rotate credentials passed to potentially affected builds. Treat those builds’ artifacts as untrusted until verified, and trace downstream use or deployments. An upgrade does not recover secrets or validate artifacts produced before patching; the vendor provides no list of confirmed customer victims."
    },
    {
      "title": "Restrict agent paths while completing patching",
      "hint": "Use a reverse proxy or other path-aware control to allow /app/agents and every subpath only from expected agent source IPs, including cloud-agent and NAT egress addresses. Limit the server to trusted networks, use VPN/access controls for outside users/agents, and put the server and agents on separate hosts. Network restrictions supplement the fix."
    }
  ],
  "sources": [
    {
      "name": "JetBrains original TeamCity advisory and complete response guidance",
      "url": "https://blog.jetbrains.com/teamcity/2026/12/cve-2026-136858/",
      "says": "Affected On-Premises scope, corrected Cloud, three fixed releases, plugin coverage and all update-mode choices, exact log signal, conditional secret/artifact response and path-aware restriction.",
      "primary": true
    },
    {
      "name": "watchTowr original December 4 intelligence report",
      "url": "https://watchtowr.com/intelligence/jetbrains-teamcity-authentication-bypass-cve-2026-136858/",
      "says": "Reports December 3 Attacker Eye honeypot exploitation attempts and valid-agent-ID prerequisite; no confirmed customer victim or downstream compromise is identified.",
      "primary": true
    },
    {
      "name": "JetBrains CNA CVE record",
      "url": "https://cveawg.mitre.org/api/cve/CVE-2026-136858",
      "says": "December 2 publication, agent-registration authentication bypass, affected releases and CVSS 3.1 score 9.1.",
      "primary": true
    }
  ],
  "headline": null,
  "one_liner": null,
  "in_the_wild_note": "watchTowr reports Dec 3 honeypot attempts; customer compromises are unconfirmed.",
  "mitigation": null,
  "timeline": [
    {
      "date": "Nov 24, 2026",
      "title": "Researcher privately reports the issue",
      "body": "JetBrains credits Jiawei Guo; this is not the public disclosure date."
    },
    {
      "date": "Dec 2, 2026",
      "title": "JetBrains discloses flaw and fixed releases",
      "body": "The vendor publishes fixes, a patch-plugin alternative and log guidance; its advisory says no active exploitation was known at publication. TeamCity Cloud is corrected."
    },
    {
      "date": "Dec 3, 2026",
      "title": "watchTowr observes exploitation attempts",
      "body": "Its later original report dates Attacker Eye honeypot observations to this day. Attempts do not establish a successful compromise of any customer."
    },
    {
      "date": "Dec 4, 2026",
      "title": "Researcher publishes original attack-observation report",
      "body": "watchTowr describes the valid-agent-ID prerequisite and attack attempts. No named victim, affected-build count or confirmed downstream artifact compromise is supplied."
    }
  ],
  "body_markdown": "JetBrains disclosed **CVE-2026-136858** on December 2. An attacker who can reach an unpatched TeamCity On-Premises server over HTTP(S), without a user account, can impersonate an existing authorized build agent. watchTowr says a valid agent ID must be guessed; simple sequential IDs can make that practical. A successful takeover can intercept assigned builds and secrets, falsify results or supply tampered artifacts for downstream execution.\n\nJetBrains said it knew of no active exploitation at publication. watchTowr’s December 4 original report subsequently identifies **December 3 exploitation attempts against its Attacker Eye honeypots**. This supports L4 for active targeting of privileged CI infrastructure, while it does not establish that a real customer or downstream release was compromised.\n\nFixed vendor releases are 2026.1.7, 2026.2.3 and **2026.3** (the vendor’s two-component release name). The issue-specific, no-restart plugin covers 2021.2 and later but does not replace other security updates. All earlier unpatched releases remain exposed; automatic patch installation depends on version and configured mode. TeamCity Cloud is already corrected and JetBrains reports no evidence of Cloud exploitation. Log matches require investigation, and suspect builds’ secrets and artifacts need separate handling after patching."
}