Skip to content

[Security][AI] AgentSpecZipParser lacks the Zip Slip / Zip Bomb / entry-count defenses that SkillZipParser already enforcesΒ #15066

Closed

Description

@LiyunZhang10

Describe the bug

AgentSpecZipParser#unzipToEntries accepts ZIP uploads without the three defensive checks that its sibling SkillZipParser#unzipToEntries already enforces:

Defense SkillZipParser AgentSpecZipParser
Path traversal / absolute-path rejection (SkillUtils.validatePathSafety) βœ… ❌
Max total decompressed size (MAX_TOTAL_UNCOMPRESSED_BYTES) βœ… 50 MB ❌ unbounded
Max entry count (MAX_ZIP_ENTRIES) βœ… 500 ❌ unbounded

This opens three concrete attack vectors against any endpoint that calls AgentSpecZipParser.parseAgentSpecFromZip (AgentSpec upload):

  1. Zip Slip β€” a crafted entry like ../../etc/passwd can bypass path validation.
  2. Zip Bomb β€” a tiny compressed payload can expand to GB-scale on disk/heap (OOM DoS).
  3. Entry-count flooding β€” a zip with tens of thousands of empty entries can exhaust memory / CPU.

Expected behavior

AgentSpecZipParser should reject the three malicious inputs above, mirroring the hardening already present in SkillZipParser.

Actual behavior

All three malicious zips are parsed without any rejection (demonstrated by the new security regression tests in AgentSpecZipParserSecurityTest).

How to reproduce

See the PR: the new test class AgentSpecZipParserSecurityTest ships four regression tests that fail against current develop and pass after the fix.

Nacos Version

develop (3.2.x)

Related PR

Fix in progress at #15064

Activity

  1. added
    kind/bugCategory issues or prs related to bug.
    kind/enhancementCategory issues or prs related to enhancement.
    and removed
    kind/bugCategory issues or prs related to bug.
    on May 7, 2026
  2. added this to the 3.2.2 milestone on May 7, 2026
  3. shiyiyue1102 commented on May 8, 2026

    @shiyiyue1102
    Collaborator

    Fixed by #15064, which has been merged. Closing this issue as completed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/AIkind/enhancementCategory issues or prs related to enhancement.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions