Skip to content

Detect invalid backslash paths in extension ZIP packages - #10

Open
SaadQacif wants to merge 1 commit into
KellisLab:mainfrom
SaadQacif:Saad-the-Symbolic-Conceiver
Open

SaadQacif wants to merge 1 commit into
KellisLab:mainfrom
SaadQacif:Saad-the-Symbolic-Conceiver

Conversation

@SaadQacif

Copy link
Copy Markdown

Closes #9

Problem

Extension archives created with Windows PowerShell Compress-Archive or .NET ZipFile.CreateFromDirectory can contain backslash entry paths such as panel\main.js.

Mantis rejects these packages with the generic message Invalid extension package, which does not explain the cause or how to correct it.

Changes

  • Detect ZIP entry names containing backslashes before uploading an extension package.
  • Report the offending paths and explain that the archive must use forward slashes.
  • Read only the ZIP tail and central directory during preflight.
  • Validate EOCD candidates and central-directory boundaries.
  • Safely defer JSON, ZIP64, split, and unsupported packages to server validation.
  • Add tests for valid archives, malformed directories, archive comments, and Windows-style paths.

Validation

  • node --test: 29/29 tests passed.
  • git diff --check: passed.
  • Verified using real archives produced by PowerShell Compress-Archive.
  • Verified using real archives produced by .NET ZipFile.CreateFromDirectory.

Build note

The Bun bundle was not built locally because Bun was unavailable. The changed files pass Node syntax checks and the complete Node test suite.

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.

Improve install_extension error for ZIP entries with backslash paths

1 participant