Automated Threat Modeling

Brief Summary: JetBrains TeamCity CVE-2026-133018, Remote Code Execution via the Kotlin DSL Sandbox UI Patches Callback

A brief summary of CVE-2026-133018, a High-severity (CVSS 8.8) remote code execution flaw in JetBrains TeamCity reachable through the UI patches callback in the Kotlin DSL sandbox. The post covers the sandbox context, the fixed builds 2026.2.1 and 2026.1.5, and the related sandbox escapes fixed in the same releases.

CVE Analysis

7 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-19

Brief Summary: JetBrains TeamCity CVE-2026-133018, Remote Code Execution via the Kotlin DSL Sandbox UI Patches Callback

Introduction

JetBrains has confirmed that a user with low privileges and network access could reach remote code execution on a TeamCity server through a callback inside the Kotlin DSL sandbox, the very component meant to contain settings scripts. Because a TeamCity server typically holds source access, build credentials and signing material, code execution on that host matters well beyond a single broken build.

TeamCity is the JetBrains continuous integration and delivery server, offered as a customer-managed on-premises installation or as the managed TeamCity Cloud service. JetBrains, which has built developer tools since 2000, states that TeamCity is trusted by more than 30K DevOps teams. That is a vendor adoption claim, not an independent market-share figure. TeamCity matters because of where it sits in the software delivery pipeline. CISA has documented that a TeamCity compromise can expose source code and signing certificates or allow interference with compilation and deployment.

Technical information

Where the bug lives

The authoritative description reads: "In JetBrains TeamCity before 2026.2.1, 2026.1.5 remote code execution was possible via a UI patches callback in the Kotlin DSL sandbox." JetBrains, acting as CNA, classified it as CWE-250 (Execution with Unnecessary Privileges) and scored it CVSS 3.1 8.8 (High):

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

The callback belongs to Kotlin DSL versioned settings. When a project keeps its settings in Kotlin DSL, TeamCity compiles and runs the .teamcity scripts from the settings repository, and the server loads the resulting configuration, which changes how later builds behave.

UI patches

If an administrator changes settings in the web UI after the generated DSL has been edited by hand, TeamCity cannot reliably rewrite the user's .kt/.kts files. Instead it writes UI patches: separate scripts under .teamcity/patches/..., for example patches/buildTypes/<id>.kts, built from helper calls such as changeBuildType(RelativeId(...)) { ... }. These patch scripts are applied on top of the base DSL model.

Architecturally, this means the DSL runtime calls back into code that came from the repository in order to modify server-side settings objects. That callback is the path the advisory names.

The sandbox boundary

By default these scripts can run on the server inside a sandbox. JetBrains documents this sandbox as "not entirely isolated". Its documented restrictions are intended to block:

  • reading files outside the parent .teamcity directory
  • network calls
  • creating subprocesses
  • loading native libraries
  • reflection into internal or JDK classes

The CVE title tells us the UI patches callback offered a way out of those limits, and that the escape led to code execution on the TeamCity server. The CWE-250 classification suggests the callback executed with more privilege than a sandboxed script should have had. MITRE describes CWE-250 as performing an operation at a privilege level higher than the minimum required. The classification does not by itself mean the flaw grants operating system administrator rights.

What is not public

TeamCity is closed source and the internal issue TW-103783 is not public, so several details remain undisclosed: which sandbox restriction the callback bypasses, the affected method or endpoint, and the exact TeamCity role needed to reach it. We have not attempted to reconstruct an exploit chain, and we would caution against borrowing mechanics from the sibling Kotlin DSL CVEs listed below to fill that gap.

Attack flow (inferred from the advisory and CVSS vector)

This is a high-level reading of the public record, not a confirmed exploitation recipe.

  1. A target project uses Kotlin DSL versioned settings that are compiled and executed in the server-side sandbox.
  2. An attacker holds low privileges (CVSS PR:L) and network access to the server (AV:N). Per FIRST, network access can include an intranet, so internet exposure is not a prerequisite.
  3. Content processed through the UI patches path is applied by the DSL runtime via the patch callback.
  4. The callback runs with more privilege than the sandbox should allow and escapes its restrictions.
  5. Code executes on the TeamCity server, with High impact to confidentiality, integrity and availability and no user interaction required (UI:N).

Patch information

Fixed builds. TeamCity On Premises 2026.2.1 (build 239120) fixes the 2026.2 line, and 2026.1.5 (build 222949) fixes 2026.1 and older. Both were released on 5 October 2026, roughly six weeks before the CVE was published on 19 November 2026. The JetBrains TeamCity security bulletin lists the issue as "Remote code execution was possible via a UI patches callback in the Kotlin DSL sandbox", rated High, tracked internally as TW-103783 and reported by Antoni Tremblay.

What is public and what is not. There is no public commit, diff or pull request. The fix ships only in binary releases. The YouTrack page for TW-103783 shows no content and the REST API returns "Entity with id TW-103783 not found". The release notes do not name individual security items. They give totals (41 security problems fixed in 2026.2.1, 27 in 2026.1.5) and point to the Security Bulletin, which is the source of the CVE mapping. The JetBrains release blog describes the updates as mainly security work covering more than 40 vulnerabilities across both versions and recommends upgrading as soon as possible.

What the fix most likely does (inferred, not confirmed). Based on the advisory wording, the fix most likely brings the UI patches callback fully under the sandbox restrictions, so patch scripts can no longer use it to obtain privileged server context or perform operations the sandbox normally forbids. This CVE is one of a group of Kotlin DSL sandbox escapes closed in the same releases:

  • CVE-2026-133014: public reflection (TW-103045)
  • CVE-2026-133015: boot classpath libraries (TW-103144)
  • CVE-2026-133016: script definitions in the settings repository (TW-103534)
  • CVE-2026-133018: the UI patches callback (TW-103783), the subject of this post
  • CVE-2026-133019: a context parameters callback (TW-103845), from the same reporter
  • CVE-2026-133023: Kotlin DSL compiler arguments (TW-104058)
  • CVE-2026-133026: code injection in generated DSL through matrix build parameters (TW-104278)

Taken together, the list looks like a broader hardening of the server-side DSL sandbox rather than one isolated change, so partial or hand-built fixes are not realistic.

Getting the fix. All bugfix releases within a major series share the same data format, so moving within a series (for example 2026.2 to 2026.2.1) does not require backup and restore. Fixed builds are available through automatic update, as installers and archives from the JetBrains download page, or as updated Docker images. TeamCity security notes point out that critical updates download automatically but still require administrator approval to install. Later releases, 2026.2.2 and 2026.1.6 (3 November 2026), also include the fix.

Related setting. TeamCity can compile and run Kotlin DSL on a build agent instead of the server. JetBrains describes this as the more secure option because scripts run on a separate machine rather than in the partly isolated server sandbox. The tradeoff is that agent-side code is not subject to the sandbox and can do anything the agent environment allows. It is a configuration choice and does not replace the fixed builds. Least privilege, via predefined roles and project-specific authorization, remains a useful supporting control.

Affected systems and versions

The CNA data in NVD lists two affected ranges:

  • TeamCity 2026.2 before 2026.2.1 (CNA range 2026.2 < 2026.2.1). This means 2026.2 itself is affected, even though it is numerically higher than 2026.1.5.
  • All TeamCity versions before 2026.1.5 (CNA range 0 < 2026.1.5), covering the 2026.1 line and older releases.

Fixed versions are 2026.2.1 (build 239120) and 2026.1.5 (build 222949), plus later maintenance releases such as 2026.2.2 and 2026.1.6.

The vulnerable component is the server-side Kotlin DSL sandbox used for versioned settings. The public record does not separately establish TeamCity Cloud exposure or remediation status.

Vendor security history

The clearest precedent is CVE-2023-42793. CISA and partner agencies reported that Russian Foreign Intelligence Service (SVR) actors, also associated in that advisory with APT29 and NOBELIUM/Midnight Blizzard, exploited it against TeamCity servers beginning in September 2023. JetBrains had issued a patch in the middle of that month, but internet-reachable servers that stayed unpatched remained exposed. The agencies described exploitation at scale: a few dozen compromised companies across the United States, Europe, Asia and Australia, over a hundred compromised devices, and follow-on activity including privilege escalation, lateral movement, additional backdoors and persistent access.

That case shows why TeamCity updates deserve attention, and why patch availability and customer protection are separate milestones. It is not evidence about CVE-2026-133018. As of 19 November 2026, the reviewed CVE and NVD records do not establish active exploitation, attribution or a public exploit for this flaw, and the retrieved CISA KEV catalog view was inconclusive. Indicators from the 2023 campaign should not be reused as detections for this sandbox callback issue.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization