# TeamCity flaw let unauthenticated attackers impersonate build agents and take their secrets

Source: https://startwithidentity.com/blog/2026-12-02-teamcity-flaw-let-unauthenticated-attackers-impersonate-build-agents-and-take-their-secrets/
Last updated: 2026-12-02
License: content by Start with Identity. Cite the source URL.

---

JetBrains disclosed CVE-2026-136858 on December 2, a critical flaw affecting all TeamCity On-Premises versions ([JetBrains](https://blog.jetbrains.com/teamcity/2026/12/cve-2026-136858/)). [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-136858) describes it as an "authentication bypass during agent registration" that allowed takeover of authorized build agents, rated CVSS 9.1 (CWE-639). An unauthenticated attacker who can reach the server over HTTP(S) can impersonate an existing agent without a TeamCity account, receive the builds assigned to it, read the credentials passed to those builds, and publish falsified results or tampered artifacts. Fixed releases are 2026.1.7, 2026.2.3 and 2026.3, and a security patch plugin covers 2021.2 and later without a restart. TeamCity Cloud was already patched. JetBrains knew of no exploitation at publication, but [The Hacker News](https://thehackernews.com/2026/12/critical-jetbrains-teamcity-flaw-lets.html) reports watchTowr has since seen attempts that guess sequential agent IDs.

## Why it matters

A build agent is a [non-human identity](https://startwithidentity.com/glossary/machine-identity/) that the CI server trusts with deploy keys, cloud credentials and signing material. Here the server accepted a new registration for an existing agent without proving the caller held that agent's credential, so whoever registered became the agent.

Patch or install the plugin, then follow JetBrains' log check: an "existing agent, but different authorization token" entry with a non-empty token signals an attempt. Where you find one, [rotate](https://startwithidentity.com/glossary/secrets-rotation/) every secret passed to that agent's builds and treat its artifacts as untrusted. Restrict `/app/agents` at the reverse proxy to agent source IPs, and prefer short-lived [workload identity](https://startwithidentity.com/glossary/workload-identity/) tokens over long-lived secrets in build parameters. See [secrets in repositories and CI](https://startwithidentity.com/techniques/secrets-in-repositories-and-ci/) and the [CVE-2026-136858 brief](https://startwithidentity.com/cves/cve-2026-136858/).

Source: [JetBrains](https://blog.jetbrains.com/teamcity/2026/12/cve-2026-136858/), [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-136858), [The Hacker News](https://thehackernews.com/2026/12/critical-jetbrains-teamcity-flaw-lets.html)
