Skip to content

feat(lfi): Add detection for Vite.js path traversal (CVE-2025-30208)#4407

Merged
EsadCetiner merged 3 commits into
coreruleset:mainfrom
disisto:feat/vitejs-path-traversal
Jan 16, 2026
Merged

feat(lfi): Add detection for Vite.js path traversal (CVE-2025-30208)#4407
EsadCetiner merged 3 commits into
coreruleset:mainfrom
disisto:feat/vitejs-path-traversal

Conversation

@disisto
Copy link
Copy Markdown
Contributor

@disisto disisto commented Jan 16, 2026

Description

Add detection for Vite.js development server path traversal vulnerability (CVE-2025-30208).

Closes #4404

The Problem

Vite.js development servers expose /@fs/ and /@id/ endpoints that allow arbitrary file system access. Attackers are actively scanning production servers for these endpoints.

Current CRS rule 930130 catches some payloads (like /@fs/.env) because .env is in restricted-files.data, but does NOT catch system files like /@fs/etc/passwd because rule 930120 only checks ARGS, not REQUEST_URI.

The Solution

A dedicated rule (930140) matching the /@fs/ and /@id/ prefixes provides:

  • Complete coverage regardless of payload
  • Clear CVE attribution in logs
  • No false positive risk (these endpoints have no production use)

Testing

  • 5 positive tests covering various attack patterns
  • 2 negative tests ensuring no false positives on legitimate URLs

References

Add rule 930140 to detect Vite.js /@fs/ and /@id/ endpoints used in
path traversal attacks. Includes 7 regression tests.

Closes coreruleset#4404
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 16, 2026

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

Copy link
Copy Markdown
Member

@EsadCetiner EsadCetiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add your change to restricted-files.data instead? It's much cheaper performance wise to use the @pmFromFile operator here in one rule, rather than creating another rule with a regex.

Per reviewer feedback, added /@fs/ and /@id/ entries to
restricted-files.data instead of creating a separate rule 930140.

This leverages the existing @pmFromFile operator for better performance.

Tests added to 930130.yaml (test_id 4-6).
@disisto disisto force-pushed the feat/vitejs-path-traversal branch from 6f7c602 to abc63e6 Compare January 16, 2026 18:47
@disisto
Copy link
Copy Markdown
Contributor Author

disisto commented Jan 16, 2026

Good point, thanks for the feedback.

Updated the PR:

  • Added /@fs/ and /@id/ to restricted-files.data
  • Removed the separate rule 930140
  • Added tests to 930130.yaml (test_id 4-6)

This leverages the existing @pmFromFile operator for better performance.

Copy link
Copy Markdown
Member

@EsadCetiner EsadCetiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks ready to merge. Can you add your name to the test file?

@disisto
Copy link
Copy Markdown
Contributor Author

disisto commented Jan 16, 2026

Done, added my name to the test file. Thanks for the quick review!

@EsadCetiner EsadCetiner added this pull request to the merge queue Jan 16, 2026
Merged via the queue into coreruleset:main with commit 581b977 Jan 16, 2026
8 checks passed
@EsadCetiner EsadCetiner added release:new-detection In this PR we introduce a new detection release:new-feature This PR introduces a new feature labels Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:new-detection In this PR we introduce a new detection release:new-feature This PR introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rule Request: Vite.js /@fs/ Path Traversal (CVE-2025-30208)

2 participants