Critical TeamCity Flaw Lets Attackers Hijack Build Agents: Patch Now
JetBrains has fixed CVE-2026-136858, a critical TeamCity On-Premises flaw that lets an unauthenticated attacker impersonate build agents and steal build secrets. Here is how to patch or mitigate.
In this article
- Key takeaways
- What happened
- What an attacker can do
- Why it matters, even if you have never heard of TeamCity
- The other JetBrains fixes in this batch
- How to fix it
- 1. Upgrade TeamCity On-Premises
- 2. If you cannot restart the server yet, install the security patch plugin
- 3. Restrict the agent endpoint at your reverse proxy
- 4. Check for signs of misuse
- What you should do
- Sources
If your company builds its own software, or pays a developer or agency that does, there is a good chance a continuous integration (CI) server such as JetBrains TeamCity sits behind every release. JetBrains has just fixed a critical flaw in self-hosted TeamCity that lets an attacker with no account take the place of a trusted build agent. This article explains the risk in plain terms and gives IT teams and agencies the exact steps to close it.
Key takeaways
- The flaw is tracked as CVE-2026-136858 and rated 9.1 out of 10 (critical).
- It affects all TeamCity On-Premises versions before the fixed releases. TeamCity Cloud is not affected.
- Fixed versions are 2026.1.7, 2026.2.3 and 2026.3.
- JetBrains reports no evidence of exploitation so far, but an older TeamCity flaw was exploited in real attacks, so patch quickly.

What happened
JetBrains disclosed the issue on Wednesday, 2 December, as part of a batch of 12 security fixes across its products. The TeamCity bug is an authentication bypass in the way build agents register with the server. A security researcher, Jiawei Guo, reported it responsibly to JetBrains on 24 November.
Build agents are the machines that actually compile code, run tests and package releases. The TeamCity server trusts them and hands them the jobs, along with the credentials those jobs need.
What an attacker can do
Anyone who can reach a vulnerable TeamCity server over HTTP or HTTPS can pretend to be an existing, authorised build agent. No TeamCity user account is needed. According to JetBrains, that lets the attacker:
- Push the real agent aside and intercept its builds.
- Read credentials and other secrets passed to the agent, such as cloud keys, deployment passwords and signing keys.
- Fake build results or publish tampered artefacts.
- Potentially run their own code in later builds that consume those tampered artefacts.
That last point is what makes CI flaws so serious. A poisoned build can carry malicious code into a mobile app, website or internal tool that customers then trust.
Why it matters, even if you have never heard of TeamCity
Many Nigerian and African businesses outsource development to agencies or freelancers. Those teams often run self-hosted build servers to save on subscription costs, and some expose them to the internet so remote staff can reach them. If your supplier’s build server is compromised, your app or website can be affected even though your own systems were never touched.
History is a warning here. The Hacker News notes that another critical TeamCity flaw, CVE-2026-63077, disclosed about four months ago, was later exploited in real-world attacks according to CISA. Attackers know that build servers hold the keys to many other systems.
The other JetBrains fixes in this batch
The same release fixed 11 more issues: four rated high and seven rated medium. Most are in Ktor, the Kotlin web framework, and in the Kotlin toolchain itself. They include:
- CVE-2026-142046 (8.1): an authentication bypass in Ktor, fixed in Ktor 3.6.2.
- CVE-2026-135284 (8.1): a path traversal issue in Kotlin Multiplatform metadata, fixed in Kotlin 2.5.0.
- CVE-2026-142043 (7.5) and CVE-2026-142044 (7.4): data leaks and an LDAP authentication bypass in Ktor, fixed in 3.6.2 and the supported older branches.
If your developers build Android apps or backend services in Kotlin, ask them to upgrade these libraries in their next release.
How to fix it
1. Upgrade TeamCity On-Premises
Move to 2026.1.7, 2026.2.3 or 2026.3, whichever matches your release line. Take a backup of the TeamCity data directory and database first, as you would for any upgrade.
2. If you cannot restart the server yet, install the security patch plugin
JetBrains offers a security patch plugin for customers who cannot upgrade immediately. It supports TeamCity 2021.2 and later. Treat it as a stopgap, not a replacement for the full upgrade.
3. Restrict the agent endpoint at your reverse proxy
Until you are patched, configure your reverse proxy so that requests to /app/agents and everything under it are only accepted from the IP addresses your real build agents use. Remember to include the outbound addresses of any cloud agents and the NAT gateways they pass through, or you will block your own builds.
4. Check for signs of misuse
- Review the list of connected agents for names, IP addresses or connection times you do not recognise.
- Look for builds that were unexpectedly reassigned or produced unusual artefacts.
- If you find anything suspicious, rotate the secrets your builds use: cloud keys, deployment credentials, package registry tokens and code-signing keys.
What you should do
- If you run TeamCity yourself: upgrade today, or apply the patch plugin and proxy restriction now and upgrade at the next maintenance window.
- If you use TeamCity Cloud: no action is needed for this flaw.
- If an agency or freelancer builds your software: send them a short message asking whether they use self-hosted TeamCity and, if so, when they will patch. Ask them to confirm in writing.
- For everyone: keep build servers off the open internet where possible, and put them behind a VPN or an IP allowlist.
Sources
- The Hacker News: Critical JetBrains TeamCity Flaw Lets Attackers Hijack Build Agents Without Authentication
- SecurityOnline: JetBrains Dec 2026 Fixes 12 Flaws, Bypass CVE-2026-136858
Featured image: Photo: “17° Server Room @ Work” by Leonardo Rizzi, CC BY-SA 2.0, via Openverse — source
Was this article helpful?
adminVerified expert
Cybersecurity Analyst
Federal Capital Territory (Abuja)
Credentials: MCPN, MNCS, IAENG | System Analyst · Web Developer · CEH · CC · CDST
Got expertise to share? Write for us →


