You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
security: bound decompressed style-pack ZIP entries before importing #812
The style-pack ZIP importer reads attacker-controlled entries with unbounded read_to_string / read_to_end calls:
manifest.json
the manifest-selected prompt and examples files
the optional icon
ZipArchive::by_name and file_name() avoid a direct path-traversal write for icons, but a small compressed archive can declare/decompress very large entries and exhaust process memory or local disk. Offline imports and marketplace-delivered packs both need resource limits.
Required fix
Define explicit compressed archive / uncompressed entry / total uncompressed limits appropriate for style packs.
Reject entries whose declared or streamed size exceeds the limit before allocating unbounded buffers; do not rely only on ZIP metadata.
Bound manifest, prompt, examples, and icon independently.
Validate icon extension/content policy already expected by the renderer; do not write arbitrary oversized data.
Preserve path-traversal resistance and clean up partially written assets on every error.
Activity