Skip to content

fix: reject Windows-ambiguous portable paths - #495

Open
faizan-oai wants to merge 6 commits into
mainfrom
agent/fix-windows-portable-paths
Open

fix: reject Windows-ambiguous portable paths#495
faizan-oai wants to merge 6 commits into
mainfrom
agent/fix-windows-portable-paths

Conversation

@faizan-oai

Copy link
Copy Markdown
Contributor

Summary

Severity: P1–P2. Windows reserved names, trailing dots or spaces, alternate streams, case-insensitive collisions, and other ambiguous components can make distinct logical paths address the same filesystem object. This rejects those inputs at the relevant contract, archive, repository, output, and multiscan boundaries.

Changes

  • Add one shared TypeScript validator for Windows-unsafe path components.
  • Reject non-portable contract artifacts and case-insensitive artifact collisions.
  • Reject ambiguous plugin ZIP entries, runtime paths, repository paths, and multiscan task IDs.
  • Reject NTFS alternate-stream scopes on Windows while preserving valid colon-containing POSIX paths.
  • Mirror contract checks in the bundled Python finalizer.

Testing

  • pnpm run format — passed.
  • pnpm run types — passed.
  • pnpm run build — passed.
  • Focused portable-path regressions — 12 passed and 1 platform-opposite test skipped on Windows.
  • git diff --check origin/main...HEAD — passed.

Risk and rollout

The change intentionally rejects names that are not portable or are ambiguous on Windows. POSIX colon-containing path components remain accepted outside Windows. No stored-data migration is required.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@faizan-oai faizan-oai changed the title Reject Windows-ambiguous portable paths fix: reject Windows-ambiguous portable paths Aug 17, 2026
@github-actions github-actions Bot added the bug Something isn't working label Aug 17, 2026
@faizan-oai
faizan-oai force-pushed the agent/fix-windows-portable-paths branch from 5adde7a to 20a0bc8 Compare August 17, 2026 20:17
@faizan-oai
faizan-oai force-pushed the agent/fix-windows-portable-paths branch from 19ac119 to 5de0011 Compare August 17, 2026 20:23
@faizan-oai
faizan-oai marked this pull request as ready for review August 17, 2026 20:27

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 5de0011508c4 for correctness and simplification. One reproduced Unix-path regression and one optional deduplication. The source-path regression was checked against both the base and this head.

This is a non-blocking review. I did not run the full SDK suite or native Windows tests locally.

Comment thread sdk/typescript/_bundled_plugin/scripts/finalize_scan_contract.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_rank_input.py
mldangelo-oai
mldangelo-oai previously approved these changes Aug 17, 2026

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rechecked 5de0011. The Unix source-path regression still reproduces at this head. Keeping it as a non-blocking follow-up. Approving the reviewed head.

"sarif": "exports/results.sarif",
}
WINDOWS_INVALID_PATH_CHARACTERS = frozenset('<>:"|?*')
WINDOWS_RESERVED_DEVICE_NAMES = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you ask your agent to simplify this part? IMHO we should let codex handle this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants