펜테스팅 위키
  • Welcome
    • Home
  • 정보 수집
    • OSINT
      • Sub Domain
      • Google Hacking
      • Github
      • IP Address
      • Employees
    • 내부망
      • RID Cycling
      • Password Spraying
      • Password Must Change
      • Extension
        • xlsx/ods
        • pfx
        • vhd
        • pst
        • vbs
        • hc
      • Protocol
        • 21 - FTP
        • 22 - SSH
        • 25 - SMTP
        • 23 - Telnet
        • 53 - DNS
        • 80/443 - HTTP
        • 88 - Kerberos
        • 111 - RPC
        • 135 - msrpc
        • 139/445 - SMB
        • 389/636 - LDAP
        • 1433 - MSSQL
        • 5985/5986 - wsman
  • 초기 침투
    • CVEs
      • CVE-2025-31486
    • Phishing
      • Command File
      • EXE + LNK
      • wax
      • Microsoft Word
    • Web
      • Quary Language
        • SQL
        • GraphQL
      • File Upload
      • File Download
      • XSS
      • SSRF
      • CSRF
      • Open Redirect
      • SOP / CORS
    • ZIP Slip
  • 지속성
    • Active Directory
      • Golden Tickets
      • Diamond Tickets
      • DC Shadow
      • RID Hijacking
      • Certificate
    • Local
      • Task Scheduler
      • Startup Folder
      • Registry AutoRun
      • COM
      • WMI Event Subscription
      • SSH Key Injection
      • DLL Hijacking
      • DLL SideLoading
      • Create Account
  • 권한 상승
    • Active Directory
      • DACL
        • ReadGMSAPassword
        • ReadLAPSPassword
        • ForceChangePassword
        • AddSelf
        • GenericAll
        • Inherited GenericAll
        • WriteOwner
        • GenericWrite
        • WriteProperty
        • WriteSPN
        • AddMembers
        • WriteGPO
        • AddAllowedToAct
        • AllExtendedRights
        • Restore-ADObject
      • AD CS
        • Abuse Permissions
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC5
        • ESC6
        • ESC7
        • ESC8
        • ESC9
        • ESC10
        • ESC11
        • CVE-2022-26923
        • Non-PKINIT
      • MS14-068
      • Server Operators
      • DnsAdmins
      • noPac
      • Silver Tickets
      • KrbRelayUp
      • GPO
    • Windows
      • SeImpersonatePrivilege
      • Unquoted Service Path
      • Weak Service Permissions
      • Weak Service Binary Permissions
      • UAC Bypass
      • Always Install Elevated
      • Autoruns
      • Credential Manager
      • Local Service Account
  • 민감정보 탈취
    • Active Directory
      • Kerberoasting
      • Timeroasting
      • Targeted Kerberoast
      • ASRep-Roasting
      • AS Requested Service Tickets
      • Unconstrained Delegation
      • Constrained Delegation
      • Alternate Service Name
      • Resource Based Constrained Delegation
      • Shadow Credentials
      • DCSync
      • LSASS
      • Backup Operators
      • SeEnableDelegationPrivilege
      • Domain Cached Credentials
      • Network Access Account Credentials
      • DPAPI Backup Key
    • Windows
      • Unattended File
      • DPAPI
      • Hard-coding Credentials
      • SeBackupPrivilege
  • 측면 이동
    • File Transfer
      • SCP
      • ZIP
      • ncat
      • Python
      • PowerShell
      • certutil
      • wget
      • SMB
      • Base64
      • FTP
      • WebDav
      • cURL
    • Pivoting
      • SOCKS
      • Proxifier
      • Remote Port Forwarding
    • NTLM Relay
    • WebDAV Relay
    • WinRM
    • PsExec
    • WMI
    • DCOM
    • RDP
    • Port Forwarding
    • Domain Trust Discovery
  • 사용자 가장
    • Pass the Hash
  • Pass the Ticket
  • Overpass the Hash
  • Token Impersonation
  • Make Token
  • Process Injection
  • Domain Trust
    • Active Directory Trusts
    • Two-way Domain Trust
    • One-way Domain Trust
  • ETC
    • CS
      • Active Directory
      • Kerberos
      • NTLM
      • PKINIT
      • Integrity
      • Registry
      • Delegation
      • OAuth 2.0
      • S4U
      • SCCM
      • SID History
      • TRUSTWORTHY
      • Link Server Passwords
      • SSL Pinning
    • Tools
      • Mindmap
      • Cobalt Strike
      • BloodHound
      • LDAP Search
      • Hydra
      • Hashcat
      • Ligolo-ng
    • Home Lab
Powered by GitBook
On this page
  • Practice
  • References

Was this helpful?

Export as PDF
  1. 초기 침투
  2. CVEs

CVE-2025-31486

영향을 받는 버전
영향을 받지 않는 버전
조치 방안
  • 6.2.0 <= Vite <= 6.2.4

  • 6.1.0 <= Vite <= 6.1.3

  • 6.0.0 <= Vite <= 6.0.13

  • 5.0.0 <= Vite <= 5.4.16

  • Vite <= 4.5.11

  • Vite >= 6.2.5

  • 6.1.4 <= Vite < 6.2.0

  • 6.0.14 <= Vite < 6.1.0

  • 5.4.17 <= Vite < 6.0.0

  • 4.5.12 <= Vite < 5.0.0

버전 업데이트

Practice

취약한 Vite를 설치하기 위해 node.js 및 취약한 버전의 Vite를 설치합니다.

# node.js 및 vite 설치
sudo apt update
sudo apt install curl
sudo apt purge nodejs -y
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# 취약한 버전으로 다운그레이드
npm uninstall vite
rm -rf node_modules package-lock.json
npm install vite@5.4.14 --save-dev

# 프로젝트 생성
npm create vite@latest

# vite 실행
npm install 
npm run dev

설치 후 Vite 접근을 허용할 호스트 목록을 작성합니다. 실제로는 개발자 본인 IP 혹은 팀원 IP만을 허용할 수 있지만, 이미 제어권 탈취가 이뤄졌다는 전제 하에 본 실습에서는 허용 가능 IP를 모든 IP인 0.0.0.0으로 설정합니다.

# 설정 파일 생성
nano vite.config.js

# 아래 내용 삽입
import { defineConfig } from 'vite'

export default defineConfig({
  server: {
    host: '0.0.0.0'
    fs: {
      allow: [
        '/home/ubuntu/test_project'
      ]
    }
  }
})

Vite는 기본적으로 vite.config.js 파일에서 지정한 경로 하위에 있는 파일만 접근할 수 있습니다. 예를 들어 /etc/passwd와 Vite의 프로젝트 경로는 다르기 때문에 아래와 같이 권한 오류가 발생합니다.

또한 취약한 버전이 아닌 안전한 버전에서는 아래와 같이 정상적 경로에서 경로이동 문자를 삽입하여 다른 경로의 파일에 접근하려고 하더라도 Vite의 홈페이지로 리다이렉션 되는 것을 확인할 수 있습니다.

하지만 서버에서 실행중인 안전한 버전을 취약한 버전으로 다운그레이드 시 아래 사진과 같이 설정 파일에서 허용하지 않은 /etc 디렉토리 하위에 있는 파일을 다운로드 하는 것이 가능합니다.

이 취약점의 실행 권한은 슈퍼 권한이기 때문에 모든 파일을 읽을 수 있습니다.

References

PreviousCVEsNextPhishing

Last updated 18 days ago

Was this helpful?

Vite Arbitrary File Read Vulnerability (CVE-2025-31486) - NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks.NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks.
Incorrect Authorization in vite | CVE-2025-31486 | SnykLearn more about npm with Snyk Open Source Vulnerability Database
Logo
권한 오류로 인해 접근 불가능한 /etc/passwd
안전한 버전에서 경로 이동 문자 삽입 시 홈페이지로 리다이렉션
다운로드에 성공한 /etc/passwd
다운로드에 성공한 /etc/shadow
Logo