A build server does more than compile code. It holds the credentials that deploy that code to production, sign it and push it to your cloud tenant. When JetBrains disclosed CVE-2026-136858 on 2 December 2026, the detail that mattered was not the CVSS score of 9.1. It was what the flaw lets an attacker become: a trusted build agent, which receives your builds and the secrets that come with them.
To be clear from the start: JetBrains reports no evidence that this flaw is being exploited. But the previous critical TeamCity flaw, CVE-2026-63077, was added to CISA's Known Exploited Vulnerabilities catalog in August, and TeamCity servers have been targeted repeatedly over the years. Patch now, then check whether anyone got there first.
What happened
CVE-2026-136858 is an authentication bypass in TeamCity On-Premises. An attacker who can reach the server over HTTP or HTTPS needs no credentials and no TeamCity account. JetBrains says the flaw lets them impersonate an existing authorised build agent. Once they have displaced the real agent, they can:
- receive the builds that were meant for that agent,
- read the credentials and other secrets passed to it for those builds,
- report false build results, and publish tampered artifacts.
The last point is the one that reaches beyond the build server. Any later build or deployment that uses a tampered artifact could run the attacker's code, inside your release process and with its trust.
The flaw was reported to JetBrains by a security researcher on 24 November, and fixes were published with the advisory on 2 December. JetBrains has not published the root cause in code-level detail.
Why a build agent is worth impersonating
A build agent is the machine that actually runs your pipeline steps. To do its job it is handed whatever the build needs: repository tokens, package feed keys, signing certificates, and often the client secret of a cloud service principal that deploys to Azure. Many teams put those secrets in the CI system precisely so that developers never see them. That makes the agent the one place where they all arrive in usable form.
An attacker posing as an agent does not need to break into anything else. The server sends the secrets to them. This is the same reason we treat developer workstations as Tier 0, and why the wfx- CI stealer went after pipeline credentials last month rather than anything on the build output.
Who is affected
Every version of TeamCity On-Premises is affected. TeamCity Cloud has been patched by JetBrains and needs no action. Exposure depends heavily on where the server sits: a server reachable from the internet, or from a broad internal network, is far more exposed than one reachable only from known build agents. Check this first, because it also determines how urgent the hunting below is.
What to do now
- Upgrade. The fixed versions are 2026.1.7, 2026.2.3 and 2026.3. If you cannot restart the server straight away, JetBrains provides a security patch plugin for TeamCity 2021.2 and later.
- Restrict the agent endpoint. As an interim measure, JetBrains advises configuring the reverse proxy in front of TeamCity to allow requests to
/app/agentsand its subpaths only from the IP addresses your build agents use. Remember the outbound addresses of cloud agents and any NAT gateways in front of them. This is a sensible control to keep after patching, too. - Take the server off the internet. If developers reach TeamCity over the internet, put it behind a VPN or an identity-aware proxy. Agents can usually connect outbound to a private address.
- Review the agent list. In the TeamCity UI, look for agents you don't recognise, agents that were authorised recently, and familiar agent names connecting from unfamiliar addresses.
Hunting in Microsoft Sentinel and Defender XDR
These queries are starting points to tune, not finished detections. Table names depend on how your reverse proxy and TeamCity server send logs to Sentinel, so adapt them to your own sources and run them across at least 30 days.
1. Agent endpoint requests from outside your agent allow-list
This example assumes reverse-proxy or web-server logs arriving in CommonSecurityLog. If your proxy writes to W3CIISLog or a custom table, swap the table and field names.
let AgentIPs = dynamic(["10.20.0.11", "10.20.0.12", "203.0.113.40"]); // your agents and NAT gateways
CommonSecurityLog
| where TimeGenerated > ago(30d)
| where RequestURL has "/app/agents"
| where SourceIP !in (AgentIPs)
| summarize Requests = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Urls = make_set(RequestURL, 20) by SourceIP, DeviceName
| order by Requests desc
Any hit from an address that is not one of your agents is worth explaining, whether or not it succeeded.
2. Pipeline service principals signing in from somewhere new
If an attacker received a pipeline's Azure credentials, the next thing you would expect to see is that service principal signing in from an address your build agents never use.
let PipelineSPNs = dynamic(["sp-deploy-prod", "sp-build-shared"]); // service principals your pipelines use
let Known = AADServicePrincipalSignInLogs
| where TimeGenerated between (ago(60d) .. ago(7d))
| where ServicePrincipalName in (PipelineSPNs)
| distinct ServicePrincipalName, IPAddress;
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(7d)
| where ServicePrincipalName in (PipelineSPNs)
| join kind=leftanti Known on ServicePrincipalName, IPAddress
| project TimeGenerated, ServicePrincipalName, AppId, IPAddress, Location, ResourceDisplayName, ResultType
3. What those identities did next
Where a service principal does appear from a new address, look at the changes it made in Azure. New role assignments, new credentials on applications, and new resources outside the usual deployment pattern are the ones to examine first.
AzureActivity
| where TimeGenerated > ago(7d)
| where Caller in ("<appId of the pipeline service principal>")
| where OperationNameValue has_any ("roleAssignments/write", "Microsoft.Web/sites/write", "Microsoft.Compute/virtualMachines/write", "Microsoft.KeyVault/vaults/secrets")
| project TimeGenerated, Caller, CallerIpAddress, OperationNameValue, ResourceGroup, _ResourceId, ActivityStatusValue
4. Unusual processes on the TeamCity server itself
If the server has Defender for Endpoint, look for shells and scripting engines started by the TeamCity Java process. Some will be legitimate maintenance; anything new deserves a look.
DeviceProcessEvents
| where Timestamp > ago(30d)
| where DeviceName has "teamcity" // or your server's name
| where InitiatingProcessFileName in~ ("java.exe", "java")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "bash", "sh", "curl.exe", "certutil.exe")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessCommandLine
Take the secrets out of the pipeline
Patching closes this flaw. It does not change the fact that your build system holds long-lived secrets that are valuable to anyone who reaches it. The more lasting fix is to give the pipeline fewer secrets to lose.
- Use workload identity federation. Instead of storing a client secret for an Azure service principal, let the pipeline exchange a short-lived token for access. Our explainer on workload identity federation covers how it works.
- Scope each identity tightly. A build that deploys one web app should not hold a service principal with Contributor across the subscription.
- Keep secrets in a vault, not in build configuration. See our guide to secrets management.
- Sign and verify artifacts. If deployments only accept artifacts signed by a key the build agent never sees, a tampered artifact fails at the gate.
We have published a wider explainer on CI/CD security alongside this piece, covering the rest of the pipeline.
If you find something
Treat a confirmed or unexplained agent impersonation as a compromise of every secret that agent could have received. Rotate those credentials from a clean device, starting with cloud service principals and signing keys. Rebuild recent release artifacts from a trusted state, and review the Azure activity of the affected identities over the whole period of exposure.
How a managed SOC helps
A build agent connecting from a new address, and a deployment identity signing in from somewhere it never has, are both quiet events. Seen together, within the same hour, they tell a clear story. Connecting them needs someone watching the identity and infrastructure signals together, at any hour.
Our SOCs are staffed 24/7, and we have run Microsoft Sentinel since 2019. Microsoft Sentinel is the only hard requirement: the connectors, parsers and analytical rules for the rest of the estate are built at onboarding. CYBERSHIELD AI investigates each incident through a multi-stage pipeline, with an average time to verdict of 3 minutes 30 seconds, and a senior analyst signs off by default. If you're not sure your pipeline identities are still yours, a compromise assessment can find out.
To see how we would watch your build pipeline and the identities it uses, book a demo.