TeamCity: How to Fix CVE-2026-136858 and Review Agents

TeamCity: How to Fix CVE-2026-136858 and Review Agents

The CVE-2026-136858 vulnerability, with a CVSS score of 9.1, allows someone who can reach an on-premises TeamCity server over HTTP(S) to impersonate an authorized build agent without authenticating. They could intercept builds, access secrets, and alter results or artifacts. JetBrains says it is not aware of any active exploitation.

Check whether your installation is affected

The risk applies to TeamCity On-Premises, that is, servers installed and managed by the organization itself. JetBrains says all on-premises versions are affected; having the server behind a login is not enough, because the described attack does not require a TeamCity account. The stated requirement is that the attacker can reach the server over HTTP(S).

If you use TeamCity Cloud, you do not need to take action: JetBrains says it applied corrective measures to the service and found no evidence of exploitation in its Cloud environments. For on-premises installations, the fixed versions are:

Fixed versionAction
2026.1.7Update the server
2026.2.3Update the server
2026.3Install the security plugin if you cannot update
TeamCity 2021.2 or laterThe security plugin can be installed if updating is not possible

The plugin is available for TeamCity 2021.2 or later and can be installed without restarting the server. It fixes this specific vulnerability, but JetBrains recommends updating to receive other security fixes as well.

What to do, step by step

  1. Determine whether you manage an on-premises server. Confirm with the responsible team whether your installation is TeamCity On-Premises or TeamCity Cloud. If it is Cloud, JetBrains says no action is needed. If it is on-premises, consider it affected until it is updated or the plugin is applied.

  2. Prioritize updating to a fixed version. Install TeamCity 2026.1.7, 2026.2.3, or 2026.3, using TeamCity's automatic update option or by downloading and installing one of those versions. The fix is included in all three versions.

  3. If you cannot update, install the plugin. JetBrains offers it for TeamCity 2021.2 and later, and says the server does not need to be restarted. Installations running TeamCity 2024.03 or later also have security patch management through the page indicated by JetBrains. For versions from 2024.03 to 2026.2.1, review and apply pending patches under Available security updates. From 2026.2.2 onward, under Security patches, the Install automatically option automatically installs verified, compatible patches; Download and notify lets you review and apply them from the Updates page. Do not select Ignore if you need to receive and install the patches.

  4. Check whether the patch has already been installed. If you use TeamCity 2026.2.2 or later with automatic security patch installation enabled, the server should check for an available patch and install it. Verify the status in update administration; do not assume the issue is fixed just because the option is enabled.

  5. Limit who can reach the agent path. Configure the reverse proxy or another access control that can filter by path to allow requests to /app/agents and its subpaths only from the source IPs expected for legitimate agents. Include the egress addresses of cloud agents and the NAT gateways they connect through. This is an additional mitigation, not a replacement for the update or patch.

  6. Look for signs in the server log. In teamcity-server.log, search for this string:

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

    JetBrains says a non-empty token may indicate an attempt to take control of an agent. Entries with an empty token ("") are expected for this check and can be disregarded.

  7. Investigate every match with a token. Use the entry's timestamp to review the agent's connection history and the builds assigned around that time. Check whether the hostname and source IP match what is expected; also compare build logs, results, and published artifacts to determine whether the attempt succeeded.

  8. If you suspect an intrusion, contain its effects. Preserve relevant logs and build results, update or patch the server, and rotate credentials that may have passed through affected builds. Treat artifacts from those builds as untrusted until verified, and trace where they were used or deployed.

TeamCity: cómo corregir CVE-2026-136858 y revisar los agentes
© The JetBrains Blog

Mistakes to avoid

Do not confuse mitigation with remediation: restricting requests to /app/agents reduces who can reach that path, but JetBrains presents this measure as an additional safeguard. The fix is to update to one of the specified versions or apply the security plugin.

Also, do not treat an empty token as proof of an attack. JetBrains says these entries are expected; the signal it recommends investigating is a match with a non-empty token. And even if one appears, it indicates a possible attempt: check connections, builds, and artifacts to assess what happened.

Finally, do not consider the issue resolved by the plugin as if it were a full update: the plugin covers this CVE, while updating provides other fixes. JetBrains also advises against ignoring available automatic patches.

Sources: The Hacker News, The JetBrains Blog, ATLABYTE