TeamCity CVE-2026-136858 (CVSS 9.1): Unauthenticated Attackers Can Hijack Authorised Build Agents to Steal Secrets and Plant Tampered Artifacts — Update to 2026.1.7, 2026.2.3 or 2026.3

JetBrains fixed a critical TeamCity On-Premises authentication bypass that lets anyone reaching the server impersonate a build agent, intercept build secrets and tamper with artifacts, with a patch plugin back to 2021.2 and log checks to spot takeover attempts.
JetBrains has fixed a critical authentication bypass in TeamCity On-Premises, tracked as CVE-2026-136858 (CVSS 9.1), that lets an unauthenticated attacker who can reach the server over HTTP(S) take the place of an existing, already-authorised build agent. Once in that position, the attacker receives the builds meant for the real agent, along with the passwords, tokens and keys those builds use, and can send back falsified results and tampered artifacts.
Every TeamCity On-Premises version is affected. The fixed releases are 2026.1.7, 2026.2.3 and 2026.3, and a no-restart security patch plugin covers servers back to 2021.2. JetBrains says it is not aware of exploitation, but TeamCity servers have been a favourite target before, so treat this as an urgent patch.
What Happened
The advisory went out on 2 December, and the CVE record was published at 02:18 Mauritius time on 3 December (22:18 UTC, 2 December). Security researcher Jiawei Guo reported the flaw privately to JetBrains on 24 November 2026, so the fix took about a week.
JetBrains describes the bug as an "authentication bypass during agent registration" that "allowed takeover of authorized build agents". The CVE record classifies it as CWE-639 (authorisation bypass through a user-controlled key). The CVSS 3.1 vector is AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N: network-reachable, low complexity, no privileges, no user interaction, with high impact on confidentiality and integrity.
In its SSVC assessment, CISA marks the flaw as automatable with total technical impact and no exploitation so far. That combination usually means a quick move to mass scanning once a working exploit is public.
TeamCity Cloud is not affected any more: JetBrains says it has already fixed its hosted service and found no evidence that any Cloud environment was exploited. Cloud customers don't need to do anything.
Technical Details
TeamCity splits work between a central server and build agents. The server keeps a list of authorised agents, each identified by an authorisation token. It sends build jobs to them, together with the credentials, parameters and secrets each job needs. Agents return logs, test results and artifacts, which later builds and deployment pipelines often consume automatically.
CVE-2026-136858 breaks the trust in that registration step. JetBrains has not published the root cause, but the impact is clear:
- Agent displacement: the attacker can impersonate an existing authorised agent and push the real one aside, without a TeamCity user account.
- Secret theft: builds assigned to the hijacked agent go to the attacker, along with any secrets passed to them: cloud keys, registry and package-publishing tokens, signing credentials, deployment passwords.
- Tampered output: the attacker can return fake build results or publish modified artifacts. JetBrains warns that downstream builds using those artifacts "could execute attacker-supplied code".
This is not remote code execution on the TeamCity server itself, unlike earlier TeamCity bugs. For a CI/CD system, though, the outcome can be just as serious. An attacker who can quietly swap a release binary or container image, or collect the credentials used to publish them, has a direct route into software supply chains.
Who Is Affected
- All TeamCity On-Premises installations older than 2026.1.7, 2026.2.3 or 2026.3 that haven't installed the security patch plugin.
- The servers most at risk are those reachable from the internet, or from large untrusted internal networks. Many organisations expose TeamCity so remote or cloud agents can connect.
- Teams that use TeamCity to sign, package or deploy software, because tampered artifacts can travel far beyond the CI server.
TeamCity Cloud customers are covered by JetBrains' server-side fix.
Patch Status
JetBrains offers two options:
- Update to 2026.1.7, 2026.2.3 or 2026.3, by downloading the installer or using TeamCity's built-in automatic update.
- Install the security patch plugin if you can't upgrade straight away. It works on TeamCity 2021.2 and later, needs no server restart, and fixes only CVE-2026-136858.
From TeamCity 2024.03, the server can download security patches by itself. Go to Administration | Updates:
- 2024.03 to 2026.2.1: review and apply pending patches under Available security updates.
- 2026.2.2 and later: under Security patches, choose Install automatically and TeamCity will install verified patches as they are released. If the setting is Download and notify, apply the downloaded patch by hand. Ignore is not recommended.
JetBrains points out that the plugin fixes only this flaw. This matters because JetBrains disclosed more than 200 TeamCity flaws on 21 November, including a CVSS 9.8 remote code execution bug (CVE-2026-132891). Servers still on 2026.2.1 or 2026.1.5 or earlier should do a full upgrade, not just add the plugin.
What To Do Now
- Patch first: upgrade to 2026.1.7, 2026.2.3 or 2026.3, or install the patch plugin today.
- Restrict the agent endpoint: at your reverse proxy or other path-aware access control, allow requests to
/app/agentsand its subpaths only from the IP addresses your build agents use. Include the outbound addresses of cloud agents and any NAT gateways they go through. - Take TeamCity off the open internet where you can. JetBrains recommends limiting access to trusted networks and putting outside users and agents behind a VPN. Run the server and build agents on separate hosts.
- Hunt in the logs: search
teamcity-server.logfor entries containing:
of the existing agent, but different authorization token "
A non-empty token value may mean someone tried to take over an existing agent. Entries with an empty token ("") are normal and can be ignored.
grep -n 'of the existing agent, but different authorization token' /path/to/TeamCity/logs/teamcity-server.log* \
| grep -v 'authorization token ""'
- If you get a hit: use the timestamp to check that agent's connection history. Confirm the hostname and source IP are what you expect, then compare build logs, results and published artifacts for that period to see whether the attempt worked.
- If you suspect compromise: keep the logs and build results, patch, and rotate every credential passed to the affected builds. Treat artifacts from those builds as untrusted until you have verified them, and trace where they were deployed or published.
Why It Matters
TeamCity is one of the CI/CD platforms attackers already know well. Two earlier authentication bypasses, CVE-2023-42793 and CVE-2024-27198, were exploited in the wild soon after disclosure, including by state-backed groups. Build servers are valuable targets because they hold the keys to production and to the software customers install.
The timing doesn't help either. JetBrains has published no exploit details, but the advisory names the vulnerable endpoint path and the log line that shows an attempt. That gives skilled attackers, and the AI-assisted tooling now used to turn patches into exploits, a clear place to start. CISA's "automatable" rating means attackers can scan the internet for vulnerable servers once an exploit exists.
The flaw is also a reminder that a CI pipeline is only as trustworthy as its least-protected agent. Even when no attack is found, restricting where agents can register from, keeping secrets short-lived and narrowly scoped, and verifying artifacts before release all limit the damage the next agent-trust bug can do.
