CVE-2021-31912

8.8 HIGH

📋 TL;DR

CVE-2021-31912 is an account takeover vulnerability in JetBrains TeamCity where attackers could potentially hijack user accounts during password reset processes. This affects organizations running TeamCity servers before version 2020.2.3, potentially allowing unauthorized access to CI/CD pipelines and sensitive build artifacts.

💻 Affected Systems

Products:
  • JetBrains TeamCity
Versions: All versions before 2020.2.3
Operating Systems: All supported platforms
Default Config Vulnerable: ⚠️ Yes
Notes: All TeamCity installations before the patched version are vulnerable regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of TeamCity server with ability to execute arbitrary code, steal source code, modify build processes, and pivot to internal networks.

🟠

Likely Case

Unauthorized access to TeamCity accounts leading to source code exfiltration, build process manipulation, and credential theft.

🟢

If Mitigated

Limited impact with proper network segmentation, strong authentication controls, and monitoring in place.

🌐 Internet-Facing: HIGH - TeamCity servers exposed to internet are prime targets for credential theft and supply chain attacks.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this to escalate privileges.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to password reset functionality but is straightforward once identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2020.2.3 and later

Vendor Advisory: https://blog.jetbrains.com/blog/2021/05/07/jetbrains-security-bulletin-q1-2021/

Restart Required: Yes

Instructions:

1. Backup TeamCity configuration and data. 2. Download TeamCity 2020.2.3 or later from JetBrains website. 3. Stop TeamCity service. 4. Install the updated version. 5. Restart TeamCity service. 6. Verify functionality.

🔧 Temporary Workarounds

Disable password reset functionality

all

Temporarily disable password reset feature until patching can be completed

Modify TeamCity authentication settings to disable password reset

Network access restrictions

all

Restrict access to TeamCity password reset endpoints

Configure firewall rules to limit access to /app/rest/users/password/reset endpoints

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate TeamCity from internet and untrusted networks
  • Enable multi-factor authentication for all TeamCity accounts and monitor for suspicious password reset attempts

🔍 How to Verify

Check if Vulnerable:

Check TeamCity version in administration interface or via REST API at /app/rest/server

Check Version:

curl -s http://teamcity-server/app/rest/server | grep version

Verify Fix Applied:

Confirm version is 2020.2.3 or later and test password reset functionality

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed password reset attempts
  • Unusual password reset success patterns
  • Account access from unexpected locations

Network Indicators:

  • Unusual traffic to password reset endpoints
  • Multiple requests to /app/rest/users/password/reset

SIEM Query:

source="teamcity.log" AND ("password reset" OR "resetPassword") AND status="success"

🔗 References

📤 Share & Export