# TeamCity agent registration lets an unauthenticated caller take over an authorized build agent

Source: https://startwithidentity.com/cves/cve-2026-136858/
Last updated: 2026-12-04
License: content by Start with Identity. Cite the source URL.

---

## What broke

JetBrains disclosed CVE-2026-136858 on December 2, 2026: an "authentication bypass during agent registration" in TeamCity On-Premises that "allowed takeover of authorized build agents." JetBrains says an attacker who can reach the server over HTTP(S) "does not need a TeamCity user account" and can impersonate an existing authorized agent, intercept the builds assigned to it, read the credentials passed to those builds and publish tampered artifacts. All on-premises versions are affected. The JetBrains CNA scores it CVSS 3.1 9.1 and lists CWE-639 (authorization bypass through a user-controlled key); NVD had not added its own analysis when this brief was written.

Fixes ship in TeamCity 2026.1.7, 2026.2.3 and 2026.3, and a security patch plugin covers 2021.2 and later without a server restart. TeamCity Cloud was fixed by JetBrains. Researcher Jiawei Guo reported the bug on November 24. JetBrains says it is not aware of active exploitation; [The Hacker News](https://thehackernews.com/2026/12/critical-jetbrains-teamcity-flaw-lets.html) quotes watchTowr as already seeing attempts that guess low, long-lived agent IDs, which start at 1.

## Why it matters

A build agent is a [machine identity](https://startwithidentity.com/glossary/machine-identity/) that the server trusts with deploy keys, cloud credentials and signing secrets for every job it runs. Here the server let a stranger claim that identity by naming an agent it already knew, so the attacker becomes the agent and receives its secrets without stealing any token. This is the fourth TeamCity authentication flaw in this catalog after [CVE-2023-42793](https://startwithidentity.com/cves/cve-2023-42793/), [CVE-2024-27198](https://startwithidentity.com/cves/cve-2024-27198/) and [CVE-2026-63077](https://startwithidentity.com/cves/cve-2026-63077/), all three of which reached CISA KEV.

## What to do

- Update to 2026.1.7, 2026.2.3 or 2026.3, or install the security patch plugin. On 2026.2.2 and later, set security patches to install automatically.
- At the reverse proxy, allow `/app/agents` and its subpaths only from the addresses your agents use, including cloud agent egress and NAT gateways.
- Keep the TeamCity server off the internet; JetBrains recommends a VPN or other network controls for remote agents.

## After you patch

- Search `teamcity-server.log` for `of the existing agent, but different authorization token` with a non-empty token. Entries with an empty token are expected.
- For any hit, check the agent's source IP and hostname at that time against builds and artifacts it produced, rotate every credential passed to those builds, and treat their artifacts as untrusted until verified.

## Sources

- [NVD: CVE-2026-136858](https://nvd.nist.gov/vuln/detail/cve-2026-136858)
- [JetBrains: CVE-2026-136858 security bulletin](https://blog.jetbrains.com/teamcity/2026/12/cve-2026-136858/)
- [JetBrains fixed security issues](https://www.jetbrains.com/privacy-security/issues-fixed/)
- [The Hacker News: Critical JetBrains TeamCity flaw lets attackers hijack build agents](https://thehackernews.com/2026/12/critical-jetbrains-teamcity-flaw-lets.html)
