CVE-2025-25206
Executive Summary
CVE-2025-25206 is a high-severity vulnerability in eLabFTW, an open-source electronic lab notebook (ELN). The flaw stems from improper input validation, allowing an authenticated attacker to read sensitive information from the database, including login tokens. This can lead to privilege escalation, especially when cookies are enabled (the default setting). The vulnerability affects all versions prior to 5.1.15. No public proof-of-concept (PoC) or exploit code is currently available, but the risk is significant due to the potential for lateral movement and data exfiltration within research environments.
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
eLabFTW is a PHP application distributed via GitHub and Docker. The vulnerability is in the core application logic, not in a third-party package. However, organizations should verify the integrity of their eLabFTW installation and ensure they are not running modified or outdated containers.
CVSS Breakdown & Threat Level
- CVSS Score: 8.3 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network – exploitable remotely.
- Attack Complexity (AC): Low – no special conditions required.
- Privileges Required (PR): Low – attacker needs a valid user account.
- User Interaction (UI): None – no victim action needed.
- Scope (S): Unchanged – the vulnerable component is the only affected system.
- Confidentiality (C): High – sensitive data (tokens, database contents) can be read.
- Integrity (I): High – privilege escalation can lead to data modification.
- Availability (A): High – potential for denial of service or account takeover.
Threat Level: High. While the EPSS score is currently 0.0%, the vulnerability is unpatched in many installations and allows for significant data exposure.
Deep Dive & Mechanics
The vulnerability lies in an input validation failure within eLabFTW's API or data handling routines. An authenticated user can craft a malicious request that bypasses sanitization checks, causing the application to return database records that should be restricted. This includes:
- Login Tokens: Session tokens stored in the database can be extracted, allowing an attacker to impersonate other users, including administrators.
- Sensitive Data: Any data stored in the database, such as experiment notes, user credentials (if improperly stored), or configuration secrets, could be exposed.
The attack is possible because the application does not properly validate the type or structure of user-supplied input before using it in database queries or data retrieval functions. This is a classic CWE-20 (Improper Input Validation) issue.
Vulnerable vs. Patched Code
The exact vulnerable code is not publicly disclosed, but the patch in version 5.1.15 addresses the input validation flaw.
Vulnerable Code (Conceptual):
// Vulnerable: Directly uses user input without validation
$id = $_GET['id'];
$data = $db->query("SELECT * FROM experiments WHERE id = $id");
Patched Code (Conceptual):
// Patched: Validates and sanitizes input
$id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);
if ($id === false) {
die('Invalid input');
}
$stmt = $db->prepare("SELECT * FROM experiments WHERE id = ?");
$stmt->execute([$id]);
$data = $stmt->fetchAll();
The patch ensures that input is validated as an integer and uses prepared statements to prevent injection or unauthorized data access.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A valid user account on the eLabFTW instance.
- Network access to the application.
Exploitation Steps:
- Identify the vulnerable endpoint: Use a web proxy (e.g., Burp Suite) to intercept requests and look for parameters that are not properly validated (e.g.,
id,userid,token). - Craft a malicious request: Modify the parameter to include special characters or unexpected data types. For example:
orGET /api/v1/experiments?id=1 OR 1=1GET /api/v1/users?token=* - Extract sensitive data: If the request returns data for all users or experiments, the vulnerability is confirmed. Look for
tokenorauth_tokenfields in the response. - Escalate privileges: Use an extracted admin token to impersonate an administrator and gain full control.
Example cURL command:
curl -X GET "https://target-elabftw.com/api/v1/experiments?id=1%20OR%201=1" \
-H "Cookie: elabftw_session=YOUR_SESSION_TOKEN"
Blue Team (Defensive)
Detection:
- Monitor for unusual API requests with unexpected parameters (e.g.,
id=*,id=1 OR 1=1). - Look for repeated failed login attempts followed by successful authentication from the same IP (possible token theft).
- Alert on access to sensitive endpoints (e.g.,
/api/v1/users,/api/v1/config) by non-admin users.
Hunting:
- Search logs for requests containing SQL-like patterns or special characters in parameters.
- Review database access logs for queries that return an unusually large number of rows.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests with parameters containing
OR,AND,UNION, or wildcards (*). - Requests to
/api/v1/experiments,/api/v1/users, or/api/v1/tokenswith unusual parameters.
- HTTP requests with parameters containing
- Host:
- Unauthorized creation of new admin accounts.
- Changes to experiment data by unexpected users.
- Log entries showing
filter_inputfailures or database query errors.
- File:
- Modified configuration files (e.g.,
config.php) with new admin tokens. - Suspicious entries in web server access logs (e.g.,
200responses to malicious requests).
- Modified configuration files (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_25206_elabftw_input_validation {
meta:
description = "Detects attempts to exploit CVE-2025-25206 in eLabFTW"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-25206"
strings:
$s1 = "id=" ascii wide nocase
$s2 = "token=" ascii wide nocase
$s3 = "OR" ascii wide nocase
$s4 = "UNION" ascii wide nocase
$s5 = "SELECT" ascii wide nocase
condition:
any of ($s1, $s2) and any of ($s3, $s4, $s5)
}
Sigma Rule
title: CVE-2025-25206 eLabFTW Input Validation Exploit
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests attempting to exploit improper input validation in eLabFTW
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'id=*'
- 'id=1 OR'
- 'token=*'
- 'token=1 OR'
condition: selection
falsepositives:
- Legitimate use of wildcards in search queries (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-25206 eLabFTW Input Validation Exploit";
flow:to_server,established;
content:"GET"; http_method;
content:"/api/v1/"; http_uri;
pcre:"/(id|token)=[^&]*(\*|OR|UNION|SELECT)/i";
classtype:attempted-recon;
sid:10000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update eLabFTW to version 5.1.15 or later immediately.
- Restrict Access: If immediate patching is not possible, restrict API access to trusted IPs only.
- Rotate Tokens: Force all users to re-authenticate and invalidate existing session tokens.
- Audit Logs: Review access logs for signs of exploitation.
Long-Term Measures:
- Implement a Web Application Firewall (WAF) to filter malicious input.
- Enforce the principle of least privilege for user accounts.
- Regularly audit database access and user permissions.
- Enable multi-factor authentication (MFA) to mitigate token theft.
Workarounds:
- No official workarounds are available. The only fix is to upgrade.
Valters IT