Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-43795 Overview
OpenC3 COSMOS is an open-source command and control platform used to send commands to and receive data from embedded systems. CVE-2024-43795 is a reflected cross-site scripting (XSS) vulnerability [CWE-79] in the login functionality of the Open Source Edition. An attacker can craft a malicious URL containing script content in the redirect query parameter. When a victim clicks the link and authenticates, the payload executes in the browser context of the COSMOS application. The issue is fixed in version 5.19.0. OpenC3 COSMOS Enterprise Edition is not affected.
Critical Impact
Successful exploitation enables script execution in an authenticated user's browser session, allowing theft of session data or unauthorized actions against connected embedded systems.
Affected Products
- OpenC3 COSMOS Open Source Edition, versions prior to 5.19.0
- Deployments using the openc3-tool-base login component
- Not affected: OpenC3 COSMOS Enterprise Edition
Discovery Timeline
- 2024-10-02 - CVE-2024-43795 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-43795
Vulnerability Analysis
The vulnerability resides in the login redirect flow of the COSMOS web interface. The client-side login() function in auth.js accepts a redirect target and appends it to the login URL. After authentication, the Login.vue component reads the redirect query parameter from window.location.search, calls decodeURI on it, and assigns the result directly to window.location. Because no scheme or origin validation is performed, an attacker can supply a value such as javascript: followed by arbitrary script, causing the browser to execute the payload upon login. The reflected nature of the flaw requires user interaction, typically through a crafted link delivered by phishing.
Root Cause
The root cause is insufficient validation of untrusted input used in a navigation sink. The redirect parameter flows from the URL into window.location without confirming it is a same-origin relative path. Neither the original relative check nor a scheme allowlist was enforced before assignment.
Attack Vector
Exploitation is network-based and requires the victim to click an attacker-supplied URL and complete authentication. The payload is embedded in the redirect query parameter of the /login endpoint.
// Patch in openc3-cosmos-init/plugins/openc3-tool-base/public/js/auth.js
delete localStorage.openc3Token
}
login(redirect) {
+ let url = new URL(redirect)
+ let result = url.pathname
+ if (url.search) {
+ result = result + url.search
+ }
// redirect to login if we're not already there
if (!/^\/login/.test(location.pathname))
- location = `/login?redirect=${encodeURI(redirect)}`
+ location = `/login?redirect=${encodeURI(result)}`
}
// Patch in Login.vue - validates redirect is a safe relative path
const redirect = new URLSearchParams(window.location.search).get(
'redirect',
)
- window.location = decodeURI(redirect || '/')
+ if (redirect[0] === '/' && redirect[1] !== '/') {
+ // Valid relative redirect URL
+ window.location = decodeURI(redirect)
+ } else {
+ window.location = '/'
+ }
Source: OpenC3 COSMOS commit 762d7e0
Detection Methods for CVE-2024-43795
Indicators of Compromise
- Access log entries for /login requests containing redirect= parameters with javascript:, data:, or absolute URLs pointing off-origin.
- URL-encoded payloads such as %6Aavascript%3A or nested %2F%2F sequences in the redirect value.
- Referer headers indicating the login URL originated from external chat, email, or messaging platforms.
Detection Strategies
- Inspect reverse proxy and web server logs for unusual characters in the redirect query parameter passed to /login.
- Deploy Content Security Policy (CSP) reporting to capture blocked inline script execution attempts on the COSMOS domain.
- Correlate authentication events with immediate navigation to unexpected origins within the same browser session.
Monitoring Recommendations
- Enable verbose HTTP logging on the COSMOS front-end and forward events to a centralized log store for query and retention.
- Alert on repeated /login requests from a single client with varying redirect parameter values, which may indicate payload testing.
- Monitor for outbound requests from COSMOS user browsers to unknown domains shortly after login events.
How to Mitigate CVE-2024-43795
Immediate Actions Required
- Upgrade OpenC3 COSMOS Open Source Edition to version 5.19.0 or later.
- Review authentication logs for anomalous redirect parameter values processed before the upgrade.
- Rotate active session tokens and force reauthentication after applying the patch.
Patch Information
The fix is delivered in OpenC3 COSMOS 5.19.0 via commit 762d7e0e93bdc2f340b1e42acccedc78994a576e. The patch parses the redirect value with the URL constructor and reduces it to its pathname and search components, and Login.vue now enforces that the redirect begins with a single / character before assigning it to window.location. See the OpenC3 GitHub Security Advisory GHSA-vfj8-5pj7-2f9g and the GitHub Security Lab advisory for additional context.
Workarounds
- Restrict access to the COSMOS web interface to trusted networks via VPN or firewall rules until the patch is applied.
- Deploy a strict Content Security Policy that disallows inline scripts and javascript: URIs on the COSMOS origin.
- Educate operators to avoid clicking /login?redirect= URLs originating from untrusted sources.
# Upgrade OpenC3 COSMOS to the patched release
git fetch --tags
git checkout v5.19.0
./openc3.sh stop
./openc3.sh start
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

