TeamCity CVE-2026-136858 is a critical flaw in JetBrains TeamCity On-Premises, the build server many software teams run in their own office or cloud account. Anyone who can reach the server over the network can pretend to be one of its build agents, with no login. From there they can read the secrets your builds use and change what the builds produce. JetBrains released the fix on 2 December 2026. This post covers who is affected, how to patch and what to check afterwards.

If your TeamCity server is reachable from the internet, treat this as urgent. Patch first, then run the log check below.

The short answer

  • Affected: every version of TeamCity On-Premises before the fixed releases.
  • Fixed in: 2026.1.7, 2026.2.3 and 2026.3.
  • Cannot upgrade today? JetBrains has a security patch plugin for TeamCity 2021.2 and later.
  • TeamCity Cloud: already fixed by JetBrains, so there is nothing to do.
  • Attacks: JetBrains said it knew of none when it published the advisory.
  • Severity: 9.1 out of 10.

What TeamCity CVE-2026-136858 allows

A build server does its work through build agents. An agent is the machine that downloads your source code, compiles it, runs the tests and makes the final package. To do that job, the server sends the agent whatever the build needs: repository tokens, cloud keys, signing certificates and deployment passwords.

The flaw is in the step where an agent registers itself with the server. According to JetBrains, an attacker who can reach the server over HTTP or HTTPS can register as an agent that already exists and push the real one aside. The attacker then receives builds meant for that agent.

So two things can go wrong. First, the attacker can read every secret passed to those builds. Second, the attacker can send back altered results, which means your customers could receive software you did not write. That second risk is why security teams call this a supply chain problem.

Step 1: find your version

The TeamCity web interface shows the version and build number in its page footer. If yours does not, look under Administration. If you run it in Docker, the image tag tells you too:

docker ps --format '{{.Image}}' | grep -i teamcity

We did not run a TeamCity server in our lab, so we have no output to show for this step. Compare what you find with the fixed releases:

Your branchUpdate to
2026.1.x2026.1.7
2026.2.x2026.2.3
Anything else2026.3, or install the patch plugin

Step 2: patch

The clean fix is to upgrade to 2026.1.7, 2026.2.3 or 2026.3. For Docker, reports on the advisory give this image:

docker pull jetbrains/teamcity-server:2026.3

If an upgrade needs planning, install the security patch plugin first. It works on TeamCity 2021.2 and later, it fixes only this flaw, and reports say it installs without a server restart. Also, servers on 2026.2.2 or newer can switch on automatic installation of security patches, so the next urgent fix arrives by itself.

Take a backup of the TeamCity data directory before either route. That is normal practice for any upgrade.

Step 3: limit who can reach the agent address

JetBrains also suggests a network limit: allow the path /app/agents and everything under it only from the addresses of your real agents. If TeamCity sits behind Nginx, the rule looks like this. Replace 10.0.5.0/24 with your agents’ network and 8112 with the port your TeamCity listens on:

location /app/agents {
    allow 10.0.5.0/24;
    deny all;
    proxy_pass http://127.0.0.1:8112;
}

We tested this block inside a full server section in our lab on 4 December 2026 with nginx -t:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

That confirms Nginx accepts the rule. We could not test it against a real TeamCity, so check that your agents still connect after you apply it.

In addition, ask a wider question: does your build server need to be on the internet at all? Most teams can put it behind a VPN and lose nothing.

Step 4: check one log line

JetBrains published a message to look for in teamcity-server.log, which sits in the logs folder of the TeamCity installation. Search for it:

grep -n "of the existing agent, but different authorization token" teamcity-server.log

We planted one test line with that phrase in a mock log file to confirm the search works:

2:[2026-12-03 03:40:55,019]   WARN - buildServer.AGENT.registration - PLANTED TEST LINE: agent has the name of the existing agent, but different authorization token: 9f2c1e

The rest of that line is our own invention, so a real entry will look different. According to the reports on the advisory, a hit where the token is not empty may mean that someone tried to take over an agent. No hits is a good sign. However, logs rotate, so also search the older files in the same folder.

If you find a hit

Treat every secret that agent could see as exposed. Then work through this list:

  1. Patch the server if you have not done so.
  2. Replace repository tokens, cloud keys, deployment passwords and signing keys used by builds on that agent. Our exposed AWS keys guide shows the order: new key first, then disable the old one.
  3. Look at the builds that ran on that agent since the first hit. Rebuild and re-check anything you shipped from them.
  4. Review who has admin rights in TeamCity and remove accounts you do not recognise.
  5. If customer data or customer software is involved, the CERT-In six-hour rule may apply. Our CERT-In guide explains what to report.

Why build servers are a favourite target

A build server holds the keys to everything else: the code, the cloud account and the path to production. For that reason, flaws in build tools get used quickly once they are public. So treat the build server like a production system. Keep it off the public internet, update it as soon as a fix appears and give each build only the secrets it needs.

Free check: our website safety check grades your site’s HTTPS and security headers from the outside in 30 seconds.

Related guides

Sources

Not sure which of your apps are affected? Our Emergency Exposure Check (₹2,999) looks at up to five sites, hosts or product versions and gives a written verdict for each within 48 hours, with what to patch first and how to verify the fix.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

Leave a Reply