TeamCity flaw CVE-2026-136858 lets attackers hijack build agents without logging in


If you run TeamCity On-Premises, patch it today. JetBrains has fixed a flaw that lets anyone who can reach your server pretend to be one of your build agents, take the builds meant for it and read the secrets those builds use. No TeamCity account is needed.
JetBrains disclosed CVE-2026-136858 on 2 December and rates it CVSS 3.1 9.1. Researcher Jiawei Guo reported it privately on 24 November. Every On-Premises version before the fixed releases is affected. TeamCity Cloud has already been fixed, and JetBrains says it found no sign that any Cloud environment was exploited.
A day from patch to attempts
When JetBrains published its advisory, it said it wasn’t aware of any active exploitation. The next day, watchTowr said on X that its threat intelligence team was already seeing exploitation attempts.
Those claims don’t contradict each other. JetBrains was describing what it knew at publication, and watchTowr is reporting attempts, not confirmed break-ins. watchTowr hasn’t published a write-up, and the flaw isn’t in CISA’s Known Exploited Vulnerabilities catalogue as of 3 December.
The attack needs the ID of an active build agent. watchTowr says that’s not much of a barrier, because TeamCity numbers its agents from 1, so an attacker can simply count up.
TeamCity servers have a history here. CISA added CVE-2026-63077, an unauthenticated code execution flaw in the agent polling protocol, to its Known Exploited Vulnerabilities catalogue on 5 August, a little over a week after JetBrains patched it, and lists it as used in ransomware campaigns.
What a fake agent can do
JetBrains hasn’t published how the bypass works, only that it sits in agent registration. It has spelled out the impact, though.
A build server usually holds the keys to everything you ship: signing keys, cloud credentials, deployment tokens. An attacker who can read those, or swap a build’s output, has a direct route into your software and your customers’ systems.
How to fix it
Update to 2026.1.7, 2026.2.3 or 2026.3. If you can’t upgrade straight away, install the security patch plugin, which works on TeamCity 2021.2 and later without a restart. It fixes only this flaw, so plan the full upgrade too.
On 2024.03 and later, TeamCity can download the patch itself. Look under Administration, then Updates. If you’re on 2026.2.2 or later and security patches are set to install automatically, your server may already have it.
What to do
-
Patch or upgrade today. Use whichever of the options above you can do fastest.
-
Restrict the agent endpoints. JetBrains recommends that your reverse proxy, or another path-aware access control, allows requests to
/app/agentsand everything under it only from addresses where your build agents run. Include the outbound addresses of cloud agents and any NAT gateways they go through. -
Check for takeover attempts. Search
teamcity-server.logfor lines containing this text:of the existing agent, but different authorization tokenJetBrains says entries with an empty token are normal. A non-empty token may mean someone tried to take over that agent. Check that agent’s connection history around that time, and confirm its hostname and IP address are what you expect.
-
If you find signs of a takeover, treat those builds as compromised. Keep the logs, rotate every credential passed to the affected builds, and don’t trust their artifacts until you’ve verified them and traced where they went.
-
If your server was reachable from the internet and unpatched, consider rotating build secrets anyway. With attempts already reported and agent IDs easy to guess, a clean log check is reassuring but not proof.