JetBrains TeamCity CVE-2026-136858 exploited: how attackers hijack build agents without logging in
CVE-2026-136858 in JetBrains TeamCity On-Premises is exploited to hijack build agents and their secrets. Attack chain, fixed versions and the log check.
Key facts
- CVE
- CVE-2026-136858
- Severity
- Critical (CVSS 3.1 9.1, JetBrains as CNA).
- Affected
- All TeamCity On-Premises versions before 2026.1.7, 2026.2.3 and 2026.3 that are reachable over HTTP(S). TeamCity Cloud was fixed by JetBrains and needs no action.
- Exploited in the wild
- Yes. watchTowr observed exploitation attempts against its Attacker Eye honeypot network on 3 December 2026, about a day after disclosure. JetBrains' 2 December advisory said it was not aware of exploitation at the time.
- CISA KEV
- Not in the CISA KEV catalog as of 5 December 2026.
- Fixed in
- TeamCity 2026.1.7, 2026.2.3 and 2026.3, or the CVE-2026-136858 security patch plugin for 2021.2 and later (no restart needed).
- What to do now
- Update or install the patch plugin, restrict /app/agents to known agent IPs, and search teamcity-server.log for agent registrations with a different non-empty authorization token.
JetBrains TeamCity CVE-2026-136858 is an authentication bypass in TeamCity On-Premises that lets an attacker with no account impersonate an existing build agent, and it is already being exploited. JetBrains disclosed it on 2 December 2026 with a CVSS 3.1 score of 9.1 and fixes in 2026.1.7, 2026.2.3 and 2026.3. On 3 December, watchTowr saw the first exploitation attempts against its honeypot network.
A build agent is the machine that runs the jobs a TeamCity server hands out. Those jobs receive credentials and other secrets, and their output becomes the software an organisation ships. Taking over an agent is a CI/CD security incident, not just a server bug.
What happened
| Date | Event |
|---|---|
| 24 Nov 2026 | Researcher Jiawei Guo reports the flaw privately to JetBrains. |
| 2 Dec 2026 | JetBrains publishes the advisory and CVE record. Fixed releases and a patch plugin are available. JetBrains says it is not aware of active exploitation. |
| 3 Dec 2026 | watchTowr reports attempted in-the-wild exploitation against its Attacker Eye honeypots, about a day after disclosure. |
The CVE record describes it as “authentication bypass during agent registration” that “allowed takeover of authorized build agents” (CWE-639). Every TeamCity On-Premises version is affected. JetBrains says it already fixed TeamCity Cloud and found no evidence that any Cloud environment was exploited.
watchTowr’s head of threat intelligence, Jake Knott, told SecurityWeek the flaw was “reverse engineered, reproduced, and exploited in the wild” against its honeypots. He told The Hacker News that the same attacker had earlier exploited PHP2Shell against a PAN-OS device in watchTowr’s honeypot network, the chain we covered in the PAN-OS Fragnesia CVE-2026-46300 article. No victim organisations have been named, and the flaw is not in the CISA KEV catalog as of 5 December.
The attack chain, step by step
Based on the JetBrains advisory, watchTowr’s statements and Ostorlab’s analysis of the patch plugin:
- Reach the server. The attacker needs HTTP(S) access to the TeamCity server, directly or through a reverse proxy. Agents register through
/app/agentsand its subpaths. No user account is needed. - Guess an agent ID. The only real prerequisite, per watchTowr, is a valid ID of an existing agent. Knott said the attackers they captured were guessing the IDs of “long-running and commonly numbered build agents”, which is easy because IDs “start at ‘1’ and go upwards”.
- Register as that agent. The attacker presents the existing agent’s identity with a different authorization token. Ostorlab, working from the compiled patch plugin because JetBrains has not published the server source, concludes the server did not check that the claimed agent ID matched the token stored for that agent. The ID alone was enough. Knott said takeover can take “as little as two HTTP requests”.
- Receive the jobs. JetBrains says a successful attack “could displace a legitimate build agent and intercept builds assigned to it”, which exposes credentials and other secrets passed to the agent.
- Poison the output. The attacker can also falsify build results or publish tampered artifacts. In JetBrains’ words, “downstream builds that consume those artifacts could execute attacker-supplied code”.
Why it worked
An identifier was treated as a credential. Agent IDs are small sequential integers. A token existed for each agent, but the registration path did not enforce it. Ostorlab notes the patch plugin compares the presented token with the stored one, the check that was missing.
CI servers are trusted by design. Builds receive secrets so they can deploy and sign. Whoever runs the job sees those secrets, and whoever returns the artifact decides what gets shipped. That makes agent identity a supply chain control, the same lesson as the Microsoft agent-framework PyPI compromise, where CI credentials were the target.
The agent endpoint is often exposed. Cloud and remote agents need to reach the server, so the agent path tends to be reachable from wide address ranges. JetBrains’ best practice is trusted networks or a VPN, with server and agents on separate hosts.
Attackers move at disclosure speed. One day from advisory to exploitation attempts leaves no room for a monthly patch cycle.
What defenders should do
- Patch now. Update to 2026.1.7, 2026.2.3 or 2026.3. If you cannot, install the security patch plugin, which covers 2021.2 and later and needs no restart. On 2026.2.2 and later, set Administration > Updates > Security patches to “Install automatically”. The plugin fixes only this CVE.
- Restrict the agent path. Configure the reverse proxy so
/app/agentsand its subpaths only accept requests from the IP addresses of legitimate agents. JetBrains says to include the outbound addresses of cloud agents and any NAT gateways they use. - Prioritise. watchTowr recommends internet-facing servers first, then servers whose builds handle credentials or publish artifacts that other builds consume.
- If you find signs of takeover, follow JetBrains: preserve logs and build results, patch, rotate every credential passed to potentially affected builds, treat their artifacts as untrusted until verified, and trace where they were used or deployed.
How to check if you are affected
- Product: only TeamCity On-Premises is affected. TeamCity Cloud needs no action.
- Version: check Administration > About. Anything before 2026.1.7, 2026.2.3 or 2026.3 is vulnerable unless the patch plugin is installed. Ostorlab notes the plugin does not change the version string, so also look for
CVE-2026-136858-patchunder Administration > Plugins. - Exposure: test whether
/app/agentsanswers from outside your agent networks. - Logs: search
teamcity-server.logforof the existing agent, but different authorization token. Entries with an empty token ("") are expected. A non-empty token may indicate a takeover attempt. Use its timestamp to review that agent’s connection history, hostname, source IP and the builds assigned around that time, and compare them with build logs, results and published artifacts.
My take
This bug does not look dramatic in a scanner report: no shell on the server, no memory corruption. But in CI/CD, “receive the job” is the jackpot. The attacker gets the secrets the pipeline was built to protect, and with a tampered artifact they can wait for the release process to deliver their code for them.
The uncomfortable part is the sequential agent ID. Anyone who designs an enrolment protocol should assume identifiers leak or are guessable, and bind every claim to a secret. The detection guidance is also a gift: a single log string tells you whether someone tried. Run that search today, even if you patched yesterday, because the attempts started before most teams read the advisory.
Questions for this week: which TeamCity servers do we run, including the one a product team set up years ago? Is /app/agents reachable from the internet? And if an agent was hijacked last week, which secrets and artifacts would we need to rotate and rebuild? More cases in exploited vulnerabilities.
Sources
- Critical Security Issue Affecting TeamCity On-Premises (CVE-2026-136858): Update to 2026.1.7, 2026.2.3, or 2026.3 Now · JetBrains, 2 December 2026
- CVE-2026-136858 · CVE.org (CNA: JetBrains s.r.o.), 2 December 2026
- CVE-2026-136858 detail · NIST NVD
- JetBrains TeamCity Authentication Bypass (CVE-2026-136858) · watchTowr, 4 December 2026
- TeamCity Build Agent Auth Bypass (CVE-2026-136858) · Ostorlab, 3 December 2026, updated 4 December
- JetBrains TeamCity Vulnerability Exploited One Day After Disclosure · SecurityWeek, 4 December 2026
- Critical JetBrains TeamCity flaw exploited to hijack build agents · BleepingComputer, 4 December 2026
- Critical JetBrains TeamCity Flaw Lets Attackers Hijack Build Agents Without Authentication · The Hacker News, 3 December 2026