Skip to content

FIX: Detect canonical Windows targets win.ini and web.config in PathTraversalOutputScorer - #3488

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
Kaap10:fix/path-traversal-windows-targets
Oct 25, 2026
Merged

Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
Kaap10:fix/path-traversal-windows-targets

Conversation

@Kaap10

Copy link
Copy Markdown
Contributor

Description

PathTraversalOutputScorer detects path traversal payloads aimed at sensitive files. Currently, its default pattern requires windows/system32 for Windows targets, missing:

  1. windows/win.ini: The universally recognized, canonical proof-of-concept target on Windows across web security scanners, CTFs, and OWASP testing guides.
  2. web.config: The root configuration file on IIS / ASP.NET holding database connection strings, machine keys, and app secrets.

This PR adds:

  • windows{_SEPARATOR}win{_DOT}ini and web{_DOT}config into the {_FILE_END}-guarded sensitive file alternation.
  • Support for forward slashes, backslashes, literal dots, URL-encoded dots (%2e), and double-encoded dots (%252e).
  • Strict {_FILE_END} boundary checking, ensuring zero false positives on backup or extended files (win.ini.bak, web.config.old).

Fixes #3487

Tests and Documentation

  • Added positive unit tests in tests/unit/score/regex/test_path_traversal_output_scorer.py covering win.ini and web.config across forward slashes, backslashes, and encoded dots.
  • Added parameterized sentence-ending period test cases verifying ., . Then continue., .\n, and .\r\n endings.
  • Added negative unit tests verifying that single traversal walks (../web.config, ../windows/win.ini), backup extensions (.bak, .old), and extended filenames are rejected.
  • All 93 unit tests passing cleanly.
  • Code style verified with ruff check and ruff format.

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 25, 2026
Merged via the queue into microsoft:main with commit b5ae595 Oct 25, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: PathTraversalOutputScorer misses canonical Windows target windows/win.ini and IIS web.config

2 participants