TeamCity CVE-2026-136858: how a build agent gets impersonated, and what to do
AI disclosure: this post was drafted with AI assistance and reviewed and edited by the Rokkhe team. Every claim was checked against the linked public sources as of 5 Dec 2026. JetBrains published a critical TeamCity On-
AI disclosure: this post was drafted with AI assistance and reviewed and edited by the Rokkhe team. Every claim was checked against the linked public sources as of 5 Dec 2026.
JetBrains published a critical TeamCity On-Premises advisory on 2 December 2026. Exploitation attempts were seen about a day later. This post first explains how a CI server and its build agents trust each other, because the bug only makes sense with that picture. Then it covers who is exposed, how to check your logs, how to patch, and what to rotate. Every claim links to its source, and where sources differ we say so. Checked 5 December 2026, Asia/Dhaka. By the Rokkhe research team.
TL;DR
- What. CVE-2026-136858 is an authentication bypass in JetBrains TeamCity On-Premises. An attacker who can reach the server over HTTP(S), with no account, can pose as an existing build agent. They can then take that agent's builds, read the secrets passed to them, and change build results and artifacts (JetBrains).
- Who. All TeamCity On-Premises versions before 2026.3, 2026.2.3 and 2026.1.7. TeamCity Cloud is already fixed by JetBrains (JetBrains).
- How bad. CVSS 3.1 score 9.1, Critical (watchTowr).
- Exploited? watchTowr reports exploitation attempts against its honeypots on 3 December (watchTowr, SecurityWeek). We did not find the CVE in CISA's KEV catalog as of 5 December.
-
Today. Update to 2026.3, 2026.2.3 or 2026.1.7, or install JetBrains' security patch plugin. Search
teamcity-server.logfor a takeover warning. If you find one, rotate the secrets those builds could see and treat their artifacts as untrusted.
What happened
On 24 November 2026 security researcher Jiawei Guo reported the bug to JetBrains privately. On 2 December JetBrains published fixed versions, a patch plugin and an advisory. JetBrains said at that time that it was not aware of active exploitation (JetBrains).
One day later, watchTowr said its Attacker Eye honeypot network saw the bug "reverse engineered, reproduced, and exploited in the wild" about a day after disclosure (SecurityWeek). Ostorlab's write-up, published the same day, still said no public proof of concept and no in-the-wild exploitation were reported (Ostorlab). The sources are just a few hours apart, and the later one is the honeypot sighting. Plan as if exploitation is live.
First, how a CI server and its agents work
If you already run TeamCity, skip to "How the bypass works". If you use a CI service and have never run your own, this part is the base for everything else.
A CI server is the coordinator. It watches your repositories, decides when to build, keeps the build configuration, and stores the results. It does not usually run your build itself.
A build agent is a worker machine. The server hands it a job: check out this commit, run these steps, upload these files. To do the job, the agent needs to be able to reach your code and often your deployment credentials. So the server sends the agent whatever the build needs: repository tokens, cloud keys, signing keys, registry passwords.
That is why CI is a high-value target. A CI system is a place where many of your secrets meet your code, and where the files you ship are produced. Whoever controls a build controls what comes out of it.
The server needs to know which agent is which. TeamCity agents connect to the server over HTTP(S) and identify themselves with an agent identifier and an authorization token. The server keeps a token for each agent it has authorized (Ostorlab). Think of the ID as a name badge and the token as the secret password that proves the badge is yours.
How the bypass works
The identity check has two parts: "who do you say you are" (the ID) and "prove it" (the token). A safe server compares the token you present with the one it stored for that ID, and refuses a mismatch.
Ostorlab's analysis of the patch says the flaw was that TeamCity did not bind a claimed agent identity to the stored authorization token before accepting the registration. A client that could reach /app/agents could present an existing agent's identifier with a different token and be treated as that agent (Ostorlab). Ostorlab notes that JetBrains has not published the server source, so this reading comes from the compiled patch plugin and the advisory. We have not tested it.
The attacker needs one more thing: a valid agent ID. watchTowr says the attacker has to guess an active agent ID, such as "1", and that this is not a material barrier because agents start at 1 (watchTowr, watchTowr on Infosec Exchange). SecurityWeek adds that the attackers watchTowr saw were guessing agent ID numbers, and that if agents are numbered in a predictable way, exploitation is easy (SecurityWeek).
This is a classic bug class: identity claimed, proof not tied to the claim. It shows up in many systems, not only CI. When you review any system that authenticates machines, ask two questions. Is the secret checked against the identity it claims? And is the identity something an outsider can guess?
This post does not include exploit steps, request formats or code, and we will not add them.
What an attacker gets
JetBrains lists three outcomes (JetBrains):
- Displacing a real agent and taking its builds. The attacker pushes the legitimate agent out and receives the builds assigned to it.
- Reading secrets. Credentials and other secrets passed to the agent for those builds are exposed.
- Falsifying results and publishing tampered artifacts. Downstream builds that use those artifacts could then run attacker-supplied code.
The third item is the supply-chain part. A tampered artifact is a file your own pipeline produced, signed off and handed to the next stage. Later stages and later users trust it because it came from your CI. That is the trust the attacker is borrowing.
JetBrains also says that an attacker needs no TeamCity user account, only network reach to the server over HTTP(S).
Who is exposed
You are exposed if all of these are true (JetBrains, Ostorlab):
- You run TeamCity On-Premises, not TeamCity Cloud.
- The server is reachable over HTTP(S) by the attacker, directly or through a reverse proxy.
- It runs a version before the fixed ones below and does not have the patch plugin.
| Branch | Fixed version |
|---|---|
| 2026.3 | 2026.3 |
| 2026.2 | 2026.2.3 |
| 2026.1 | 2026.1.7 |
| Older (2021.2 and later) | Upgrade, or install the security patch plugin |
watchTowr says to deal first with servers reachable from outside trusted networks, including servers that accept agent connections from the internet. Servers limited to trusted networks come next (watchTowr). Ostorlab points out that a server behind an allowlist is still affected if an attacker can reach the endpoint from an allowed network or through a compromised host (Ostorlab).
How to check your server
1. Find your version. In the TeamCity UI go to Administration, then About. On a package install you can read it from the log (Ostorlab):
grep -m1 -iE 'TeamCity (server )?version|TeamCity Server [0-9]' /opt/teamcity/logs/teamcity-server.log
For a container, run the same command inside the running container, because the running container is the one that matters:
docker exec <container> grep -m1 -iE 'TeamCity (server )?version|TeamCity Server [0-9]' /opt/teamcity/logs/teamcity-server.log
2. Check for the patch plugin. Open Administration, then Plugins. A server with the patch shows CVE-2026-136858-patch. The plugin does not change the version number, so a version check alone does not prove you are protected (Ostorlab).
3. Search the server log for a takeover attempt. JetBrains says to search teamcity-server.log for this text (JetBrains):
of the existing agent, but different authorization token "<token>"
grep -F 'of the existing agent, but different authorization token' /opt/teamcity/logs/teamcity-server.log*
A non-empty token in that line may indicate a takeover attempt. Entries with an empty token ("") are expected and can be ignored for this check. Rotated log files have suffixes, so search them all. The log path above is the default for a package install, and yours may differ.
4. If you find a non-empty token, JetBrains advises you to use the timestamp to look at that agent's connection history and the builds assigned to it. Check that the host name and source IP match what you expect, then compare with build logs, results and published artifacts to see whether the attempt succeeded.
5. Check what your build agents look like from the outside. If the server is reachable from the internet, list who can reach the agent path. That is the exposure the bug needs.
We have not run these commands against a vulnerable TeamCity server. The log string and its meaning come from JetBrains. The grep wrapper is ours.
Fix it
Option 1, preferred: update. Install 2026.3, 2026.2.3 or 2026.1.7. Back up the data directory and database first. Use Administration, then Updates, or download the distribution. For containers, recreate the container, not just pull the image. Ostorlab's walk-through covers the Docker steps, including reusing your data and log volumes (Ostorlab).
Option 2: the security patch plugin. JetBrains released a plugin for TeamCity 2021.2 and later. It fixes only this CVE and can be installed without a server restart. JetBrains still recommends updating, because releases carry many other fixes (JetBrains).
Turn on automatic security patches. On TeamCity 2026.2.2 and later, go to Administration, then Updates, and under Security patches choose Install automatically. On 2024.03 through 2026.2.1 you review and apply patches under Available security updates (JetBrains).
Stopgap if you can do neither today. JetBrains suggests allowing requests to /app/agents and its subpaths only from the addresses where your real agents connect. Include the outbound addresses of cloud agents and any NAT gateway they use (JetBrains). Here is the idea in nginx, as a sketch. Adapt it to your proxy and test it before you rely on it:
location /app/agents {
allow 203.0.113.10; # your agent or NAT gateway address
allow 203.0.113.11;
deny all;
proxy_pass http://teamcity_backend;
}
The stopgap blocks the published path. It does not fix the server, and it does not stop an attacker who can send from an allowed address (Ostorlab).
After patching: rotate and verify
Patching closes the door. It does not tell you whether someone already walked through it.
- Preserve evidence first. Keep the server logs and build results before you rotate or rebuild.
- Rotate secrets that went to affected builds. If the log shows a takeover attempt for an agent, assume anything that agent's builds received could have been read: repository tokens, cloud keys, registry logins, signing keys.
- Treat artifacts as untrusted until verified. Trace where artifacts from those builds were used or deployed (JetBrains). Rebuild from a clean agent and compare hashes where you can.
- If you cannot tell, rotate anyway. A key rotation costs an afternoon. A silently tampered release costs much more.
CI hardening that applies to any CI
JetBrains' best-practice notes say to limit server access to trusted networks, use a VPN or network controls for outside connections, keep TeamCity updated, and run the server and build agents on separate hosts (JetBrains). These are general rules. Here is the same list in plain terms, for any CI:
- Keep the CI control plane off the open internet. If people or agents must connect from outside, put a VPN or an allowlisting proxy in front.
- Give each job only the secrets it needs. A secret scoped to one project cannot be read by a build in another.
- Prefer short-lived credentials. A token that expires in an hour is worth much less to a thief than a key that never expires. Many cloud providers can issue job-scoped tokens through OpenID Connect so you do not store a long-lived key in CI at all.
- Separate duties. The machine that builds should not be the machine that holds your deploy keys for every environment.
- Verify artifacts. Record hashes of what you built and check them at the next stage. Signed builds make tampering visible.
- Do not expose agents by default. Cloud agents should connect from known address ranges, so you can allowlist them.
- Patch the CI server like it is a production server. It is one. Turn on automatic security patches where the vendor offers them.
We wrote a sibling guide on one hosted CI example: pin your GitHub Actions by commit SHA and lock workflow permissions.
History: TeamCity has been here before
watchTowr's FAQ lists four earlier TeamCity vulnerabilities that were added to CISA's KEV catalog after exploitation in the wild, among them CVE-2023-42793 and CVE-2024-27198, both authentication bypasses (watchTowr). The lesson is not about one vendor. Any widely used CI server is a steady target, because of what sits inside it.
Also exploited this week
If you read advisories on a Friday, three more:
- Acronis Backup plugin for cPanel & WHM and Plesk, CVE-2026-87887. An incorrect authorization flaw that discloses sensitive information. CISA added it to KEV on 3 December with a 17 December deadline for US federal agencies. Acronis says it detected exploitation in limited, targeted attacks. Fixed builds: 1.9.3.1031 for cPanel & WHM and 1.8.12.659 for Plesk (CISA, BleepingComputer).
- Veeam Service Provider Console, CVE-2026-58072 and CVE-2026-58073. Patched in August. The Canadian Centre for Cyber Security says open-source reporting shows both are now exploited. Upgrade to 9.3.0.35057 (BleepingComputer). Veeam's own advisory had not yet marked them exploited when BleepingComputer wrote.
- Mitel MiCollab, five CVEs in the audio, web and video conferencing component (CVE-2026-133275, CVE-2026-133303, CVE-2026-133311, CVE-2026-133323 and CVE-2026-133324). CISA added all five to KEV on 25 November. Accenture's Apex Labs found the flaws used in the wild, including before Mitel's 16 November advisory, and SecurityWeek reported on 4 December that Mitel has confirmed exploitation. Apply the patch for MiCollab 10.3.0.18 (KB000129195) or upgrade to a later release (CISA, SecurityWeek, Mitel, MISA-2026-0012).
FAQ
Do I need to act if I use TeamCity Cloud? No. JetBrains says it applied the fix and found no evidence that any Cloud environment was exploited through this bug (JetBrains).
Is there a public exploit? Ostorlab said on 3 December that it knew of no public proof of concept. watchTowr says the bug was reproduced and attempted in the wild within about a day. We have not seen or tested exploit code.
Does an empty token in the log mean I was hit? No. JetBrains says empty-token entries are expected and can be disregarded. A non-empty token is the signal to investigate.
My agents run in a private network. Am I safe? Safer, not safe. The server must still be patched, because an attacker who reaches the server from an allowed network, or through another compromised machine, can still use the bug (Ostorlab).
Does the patch plugin replace the update? No. It fixes this one CVE. JetBrains recommends updating as well.
Where Rokkhe helps
Rokkhe is an AI penetration testing service. It tests only targets you have verified are yours, and it keeps the request and response behind every finding.
- If your CI server has a hostname you own, you can verify the domain and have an AI pentest map what is reachable from the internet. That tells you whether the control plane and agent paths are visible to anyone. It complements patching and does not replace it.
- PR security review checks each pull request for leaked secrets, vulnerable dependencies, risky code and infrastructure mistakes. Fewer secrets in code means fewer secrets that a CI takeover can reach.
- The Rokkhe exploited vulnerabilities list tracks CISA's KEV catalog, so you can see which of your products show up.
If you would like a second pair of eyes on how your pipeline is exposed, book a demo at rokkhe.com. We scope first, and nothing runs until you approve the scope.
Sources
- JetBrains, Critical Security Issue Affecting TeamCity On-Premises (CVE-2026-136858), 2 December 2026
- watchTowr, JetBrains TeamCity CVE-2026-136858 FAQ
- watchTowr on Infosec Exchange
- SecurityWeek, JetBrains TeamCity Vulnerability Exploited, 4 December 2026
- Ostorlab, TeamCity Build Agent Auth Bypass (CVE-2026-136858), 3 December 2026
- CISA, Adds One Known Exploited Vulnerability to Catalog, 3 December 2026
- CISA Known Exploited Vulnerabilities catalog
- BleepingComputer, Hackers exploit new Acronis Backup vulnerability in the wild
- BleepingComputer, Hackers now exploiting critical Veeam flaws patched in August
- CISA, Adds 10 Known Exploited Vulnerabilities to Catalog, 25 November 2026
- SecurityWeek, Mitel MiCollab Zero-Days Exploited, updated 4 December 2026
- Mitel Product Security Advisory MISA-2026-0012
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.