Advisory · CVE-2026-136858
TeamCity agent registration bypass lets attackers hijack build agents and steal secrets
JetBrains TeamCity On-Premises has an authentication bypass in build agent registration: an unauthenticated attacker who can reach the server can impersonate an authorized build agent, intercept its builds, and steal the credentials passed to them. WatchTowr observed exploitation attempts against its honeypot network a day after disclosure. Fixed in 2026.1.7, 2026.2.3 and 2026.3, with a security patch plugin for 2021.2 and later.
- Vendor
- JetBrains
- Product
- TeamCity
- Identifier / CWE
- CVE-2026-136858
CWE-639 - Action timing
- Immediate
Explain it like I’m five
A TeamCity server hands work to build agents, and each agent proves who it is with an ID and a secret token. The server forgot to check that the token matches the ID, so anyone can claim to be a trusted agent just by guessing its ID number. The fake agent then receives that agent's jobs, including the passwords and tokens those jobs carry.
- 01Server reachable
An unauthenticated attacker reaches a TeamCity On-Premises server over HTTP or HTTPS.
- 02Agent ID guessed
The attacker guesses the ID of an authorized build agent; agent IDs typically start at 1 and count upward.
- 03Registration accepted
The attacker presents the agent's ID with a different authorization token, and the server accepts the registration without comparing the token.
- 04Builds intercepted
The attacker's fake agent receives builds assigned to the real agent.
- 05Secrets stolen
Credentials and access tokens passed to those builds are exposed to the attacker, who can also tamper with build results and artifacts.
What happened
JetBrains TeamCity On-Premises has an authentication bypass during build agent registration. The server did not bind a claimed build-agent identity to the authorization token stored for that agent, so an unauthenticated attacker who can reach the server over HTTP or HTTPS can present an existing agent’s identifier with a different token and be treated as that agent. The attacker can intercept builds assigned to it, access build secrets, and tamper with build results and artifacts.
All TeamCity On-Premises versions are affected. JetBrains disclosed the flaw on December 2, 2026, and fixed it in 2026.1.7, 2026.2.3 and 2026.3, with a security patch plugin for servers running 2021.2 or later that cannot upgrade immediately. TeamCity Cloud is already fixed. The flaw carries CVSS 3.1 9.1. WatchTowr observed exploitation attempts against its honeypot network on December 3, a day after disclosure; JetBrains says it has no evidence of active exploitation, but publishes log indicators administrators should check.
What to do
- Upgrade TeamCity On-Premises to 2026.1.7, 2026.2.3 or 2026.3, or install the security patch plugin if an upgrade cannot happen immediately.
- Restrict the /app/agents endpoint and its subpaths to the IP addresses of legitimate build agents, at the reverse proxy if not on the server.
- Search teamcity-server.log for entries reading “of the existing agent, but different authorization token” with a non-empty token; treat those as possible takeover attempts.
- If exploitation is suspected, preserve logs and build results, rotate credentials passed to potentially affected builds, and treat their artifacts as untrusted until verified.
- Prioritize internet-facing servers first, then servers whose builds handle credentials.
Management note
The patch window here was one day. This is a build system, so a takeover does not just leak a secret, it poisons the software the organization ships. Upgrade the internet-facing servers today, lock down the agent endpoint, and check the logs for the token mismatch JetBrains flags.