Add unauth RCE exploit module for JetBrains TeamCity (CVE-2026-63077) - #21775
Add unauth RCE exploit module for JetBrains TeamCity (CVE-2026-63077)#21775sfewer-r7 wants to merge 5 commits into
Conversation
…ized agent in teh servers agent pool
…od for each target, so switching targets automaticaly chooses a correct payload for the target platform (unless uses explicitly set payload)
| end | ||
|
|
||
| def check | ||
| # login.html is available without authentication and exposes both the product headers and version string we need. |
There was a problem hiding this comment.
I think this matches
Since this is only used twice I think, it is no big deal, but if we are going to have more teamcity exploits, it might be a good idea to have a mixin.
| xml.agentDetails( | ||
| 'agentName' => identifiers[:agent_name], | ||
| 'agentAddress' => '127.0.0.1', | ||
| 'agentPort' => rand(1024..65_535).to_s, |
There was a problem hiding this comment.
If this is actually bound, maybe bump up above 10,000 to avoid collisions in the 1024-6000 space? Minimal likelihood, but still possible given Windows' love of port range in the 5000's.
| end.to_xml | ||
|
|
||
| # The caller needs the XML to trigger deserialization and the URI/token pair to trigger and confirm code execution. | ||
| [payload_xml, jsp_uri, response_token] |
There was a problem hiding this comment.
Could we return a hash here rather than an array?
There was a problem hiding this comment.
Pull request overview
Adds a new Metasploit exploit module (and accompanying documentation) for unauthenticated RCE in JetBrains TeamCity via CVE-2026-63077, leveraging the agent polling protocol’s unsafe XStream deserialization to drop and execute a one-shot JSPWS payload.
Changes:
- Introduces
exploit/multi/http/jetbrains_teamcity_rce_cve_2026_63077with AutoCheck-enabled vulnerability detection and exploit flow (agent registration → deserialization trigger → JSPWS execution/cleanup). - Implements multiple targets (JSP payload + Windows/Linux command payloads) and a configurable webroot-relative write path.
- Adds module documentation with setup guidance and recorded exploitation scenarios for Windows and Linux.
Impact Analysis:
- Blast radius: low; new module + new documentation only (no shared library/framework logic changed).
- Data and contract effects: none identified from diff (no schema/config/API changes).
- Rollback and test focus: removing the new module/doc files should fully roll back; focus validation on module loading,
check, and each target’s end-to-end exploit path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| modules/exploits/multi/http/jetbrains_teamcity_rce_cve_2026_63077.rb | New exploit module implementing CVE-2026-63077 check + exploit chain and payload delivery/cleanup. |
| documentation/modules/exploit/multi/http/jetbrains_teamcity_rce_cve_2026_63077.md | New operator documentation with testing notes, options, and scenarios. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 'Arch' => ARCH_JAVA, | ||
| 'Platform' => ['win', 'unix', 'linux'], | ||
| 'DefaultOptions' => { | ||
| 'PAYLOAD' => 'java/jsp_shell_reverse_tcp' | ||
| } |
| prepend Msf::Exploit::Remote::AutoCheck | ||
| include Msf::Exploit::Remote::HttpClient |
| @@ -0,0 +1,293 @@ | |||
| ## Vulnerable Application | |||
| [Download](https://www.jetbrains.com/teamcity/download/) and | ||
| [install](https://www.jetbrains.com/help/teamcity/install-and-start-teamcity-server.html) a vulnerable version of | ||
| TeamCity for either Windows or Linux, e.g. version 2026.1.2. By default, the server will listen for HTTP | ||
| connections on port 8111 (Older version of the product listen on port 80 by default). |
Overview
This
(draft)pull request add an unauth RCE exploit for the recent JetBrains TeamCity vulnerability, CVE-2026-63077.For a full technical analysis of CVE-2026-63077, read our Rapid7 Analysis.
TO-DO
build_java_payload_jsp.Example 1 - JSP payload on Windows
Example 2 - Command payload on Windows