Sanitize entry paths (the traversal gate)
sanitize_entry_pathsMaps archive entry names to safe '/' separated relative paths or rejects unsafe ones with the triggering rule, covering traversal, absolute, reserved, and NTFS-stream risks before external extraction.
Instructions
Apply zipnative's single traversal gate sanitizeEntryPath() to a list of names: the safe '/'-separated relative form each maps to (join it under your extraction root — never the raw name), or null with the rule that fired (empty, NUL byte, absolute, drive letter, UNC, '..' traversal, NTFS alternate data stream ':', Windows reserved device name CON/NUL/COM1…). Use it when you extract with another tool or plan an external filesystem sink. No archive needed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"names": "<names>"
},
"name": "sanitize_entry_paths"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| names | Yes | Entry names to check (as stored in an archive). | |
| fields | No | Dot-paths to keep, after verbosity (e.g. ['entryCount', 'entries.name']); unmatched ones are listed in _meta.unmatchedFields. | |
| verbosity | No | 'summary': scalar verdict fields only (the token-frugal form). | full |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| results | No | ||
| rejectedCount | No | ||
| rejectedNames | No | summary only: the rejected names. |