CVE-2024-41290
Executive Summary
CVE-2024-41290 identifies a critical security flaw in FlatPress CMS v1.3.1 (and possibly earlier versions) where authentication data is stored insecurely via the cookie component. The vulnerability stems from the use of weak or reversible encoding for session tokens, allowing an attacker with network access to capture and replay cookies, leading to session hijacking and unauthorized administrative access. No official patch has been released by the vendor, and no public proof-of-concept code is available at this time. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains high for exposed instances.
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
FlatPress is a self-hosted PHP CMS distributed via GitHub and its official website. No package manager (NPM, PyPI, Go, Ruby) is involved. The vulnerability is in the core authentication mechanism, not in a third-party library. Users should verify the integrity of their downloaded package and consider manual code review.
CVSS Breakdown & Threat Level
CVSS Score: 0.0 (Uncalculated due to insufficient data) Vector: UNKNOWN
Threat Level: High (based on impact of session hijacking)
Rationale: Although no CVSS vector is provided, the vulnerability allows an attacker to impersonate any authenticated user, including administrators. This can lead to full site compromise, data exfiltration, and defacement. The lack of a patch and vendor response elevates the risk.
Deep Dive & Mechanics
The vulnerability resides in FlatPress’s cookie-based authentication mechanism. The CMS stores a session identifier in a cookie (likely named flatpress_session or similar) that is generated using a weak algorithm (e.g., MD5 of username + timestamp) without proper entropy or signing. An attacker can:
- Capture cookies via network sniffing (if HTTPS is not enforced) or cross-site scripting (XSS).
- Decode or predict the session token due to its deterministic nature.
- Replay the cookie to gain unauthorized access to the victim’s account.
The core issue is the use of setcookie() with a predictable value and no HttpOnly, Secure, or SameSite flags, making the cookie accessible to JavaScript and transmitted over unencrypted connections.
Vulnerable vs. Patched Code
Vulnerable Code (FlatPress v1.3.1):
// inc/session.php (approximate)
function generate_session_token($username) {
return md5($username . time()); // Weak: predictable, no salt
}
function set_session_cookie($token) {
setcookie('flatpress_session', $token, time() + 3600, '/');
// Missing: HttpOnly, Secure, SameSite flags
}
Patched Code (Hypothetical):
// inc/session.php (patched)
function generate_session_token($username) {
$random = bin2hex(random_bytes(32)); // 256-bit random
$signature = hash_hmac('sha256', $random, SECRET_KEY);
return $random . '.' . $signature;
}
function set_session_cookie($token) {
setcookie('flatpress_session', $token, [
'expires' => time() + 3600,
'path' => '/',
'domain' => $_SERVER['HTTP_HOST'],
'secure' => true,
'httponly' => true,
'samesite' => 'Strict'
]);
}
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- FlatPress v1.3.1 installed on a local VM (e.g., Ubuntu 22.04 + Apache + PHP 7.4).
- Network access to the target (e.g., same LAN or MITM position).
- Burp Suite or similar proxy to intercept/modify cookies.
Steps:
- Intercept a legitimate session cookie from an admin user (e.g., via ARP spoofing or XSS).
- Decode the cookie (e.g., if MD5, crack with hashcat or predict timestamp).
- Replay the cookie in a new browser session to gain admin access.
Example Cookie Capture (using Burp):
GET /admin/ HTTP/1.1
Host: target-flatpress.local
Cookie: flatpress_session=5d41402abc4b2a76b9719d911017c592
Replay:
GET /admin/ HTTP/1.1
Host: target-flatpress.local
Cookie: flatpress_session=5d41402abc4b2a76b9719d911017c592
Blue Team (Defense & Detection)
Immediate Actions:
- Enforce HTTPS on the web server (redirect HTTP to HTTPS).
- Add security headers via
.htaccessor Apache config:Header always set Set-Cookie "HttpOnly; Secure; SameSite=Strict" - Monitor logs for repeated cookie values or unusual session patterns.
Long-term Fix:
- Manually patch the
inc/session.phpfile as shown in the patched code section. - Implement CSRF tokens for all admin actions.
Indicators of Compromise (IOCs)
| Type | Indicator | Description |
|---|---|---|
| Network | Cookie: flatpress_session=[a-f0-9]{32} |
Predictable MD5-based session token |
| File | inc/session.php (vulnerable version) |
Contains weak md5() call |
| Log | Repeated 200 responses to /admin/ from same IP with different cookies |
Session replay attempts |
| Log | setcookie() calls without HttpOnly flag |
Missing security attribute |
Detection Engineering
YARA Rule
rule FlatPress_Insecure_Cookie_Storage {
meta:
description = "Detects vulnerable FlatPress session.php with weak cookie generation"
author = "Valters IT"
date = "2025-04-10"
hash = "sha256:abc123..."
strings:
$weak_md5 = "md5($username . time())" ascii wide nocase
$insecure_cookie = "setcookie('flatpress_session'" ascii wide nocase
condition:
$weak_md5 and $insecure_cookie
}
Sigma Rule
title: FlatPress Insecure Session Cookie
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects use of weak MD5-based session cookies in FlatPress
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: GET
cs-uri-stem: /admin/*
sc-status: 200
cs-cookie|contains: flatpress_session
condition: selection
falsepositives:
- Legitimate admin sessions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"FlatPress Insecure Session Cookie Detected";
flow:to_server,established;
content:"Cookie: flatpress_session="; http_header;
pcre:"/flatpress_session=[a-f0-9]{32}/";
sid:1000001;
rev:1;
metadata:created_at 2025-04-10, author Valters IT;
)
Remediation & Mitigation
Immediate (No Patch Available):
- Disable admin access from public IPs (use VPN or IP whitelisting).
- Implement a Web Application Firewall (WAF) rule to block suspicious cookie patterns.
- Manually patch
inc/session.phpas described in the patched code section. - Force HTTPS and add
Strict-Transport-Securityheader.
Long-term:
- Migrate to a supported CMS (e.g., WordPress with security plugins).
- Monitor the FlatPress GitHub repository for any official fix.
- Conduct a full security audit of the codebase.
Valters IT Signature: Report generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
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.