News 4 min read

TeamCity CVE-2026-136858: critical flaw lets attackers hijack agents


JetBrains disclosed a critical vulnerability in TeamCity On-Premises on December 2, 2026, tracked as CVE-2026-136858, that lets an unauthenticated attacker who can reach a TeamCity server over HTTP(S) impersonate an existing build agent. Every on-premises version is affected, and the fix ships in TeamCity 2026.1.7, 2026.2.3 and 2026.3, according to the JetBrains security advisory. Because a hijacked agent sees build secrets and can tamper with artifacts, any team running its own TeamCity server should patch today.

What’s new

The advisory, written by Daniel Gallo of the TeamCity team, lays out the issue and the fixes:

CVE CVE-2026-136858
Affected All TeamCity On-Premises versions
Fixed in 2026.1.7, 2026.2.3 and 2026.3
Patch plugin For TeamCity 2021.2 and later
Login needed to exploit No
TeamCity Cloud Already fixed, no action needed
  • What an attacker can do: take the place of a legitimate build agent, intercept the builds assigned to it, read the credentials and other secrets passed to it, and falsify build results or publish tampered artifacts. JetBrains notes that downstream builds that consume those artifacts “could execute attacker-supplied code”, which makes this a supply chain risk as much as a data leak.
  • Who can exploit it: anyone who can reach the server over HTTP(S). No TeamCity user account is required.
  • Exploitation so far: JetBrains says it was not aware of any active exploitation when it published the advisory, and found no evidence that any TeamCity Cloud environment was exploited.
  • Discovery: security researcher Jiawei Guo reported the flaw privately on November 24, 2026, under JetBrains’ coordinated disclosure policy.

What it means for developers

If you run TeamCity yourself, you have two options, both from the advisory.

1. Update the server. Install 2026.1.7, 2026.2.3 or 2026.3 from the TeamCity downloads page, or use TeamCity’s automatic update option. This is the recommended fix, since a newer version also carries other security updates.

2. Install the security patch plugin. If you can’t upgrade yet, JetBrains has a patch plugin for TeamCity 2021.2 and later that fixes only this CVE and installs without restarting the server. Where to find it depends on your version, under Administration | Updates:

  • 2024.03 to 2026.2.1: review and apply it under Available security updates.
  • 2026.2.2 and later: under Security patches, choose Install automatically and TeamCity downloads and installs verified patches as they come out. Servers on 2026.2.2 or later that already had this setting on should pick up the patch by themselves.
  • Other supported versions: download the patch plugin and install it manually.

Check whether someone already tried

The advisory gives a concrete check. Search teamcity-server.log for lines containing this text:

of the existing agent, but different authorization token "<token>"

An entry with an empty token ("") is expected and can be ignored. An entry with a non-empty token may be an attempt to take over an agent. For each one, JetBrains suggests you:

  1. Use its timestamp to review that agent’s connection history and the builds assigned to it at the time.
  2. Confirm the hostname and source IP address are the ones you expect for that agent.
  3. Compare build logs, results and published artifacts to work out whether the attempt succeeded.

If you suspect a compromise, keep the logs and build results, patch the server, rotate every credential passed to the affected builds, and treat their artifacts as untrusted until you have verified them and traced where they were deployed.

Lock down the agent endpoint

As an extra layer, JetBrains recommends configuring your reverse proxy (or another path-aware access control) so that requests to /app/agents and its subpaths are accepted only from IP addresses your build agents use. Include the outbound addresses of cloud agents and any NAT gateways they connect through, or you will cut off your own agents.

The general advice in the advisory applies too: keep the TeamCity server on trusted networks, put a VPN or other access control in front of it for anyone connecting from outside, and run the server and build agents on separate hosts.

How it compares

CI servers hold deployment keys and produce the code that ships, so a flaw like this is worth more to an attacker than its narrow description suggests. The advisory does not describe code execution on the TeamCity server itself, but taking over an agent reaches the same things: the secrets a build uses and the artifacts it publishes. That is why the clean-up steps above matter as much as the patch: a server patched today can still have shipped tampered artifacts before the fix. If your build machines also run Java, check you have patched the Java4Shell OpenJDK flaw, and if your stack runs Node.js, the Node.js security releases on December 9 are next on the calendar.

Sources