Skip to content

Fix Zip Slip vulnerability, regex recompilation, and redundant hashCode#3810

Merged
guiyanakuang merged 1 commit intomainfrom
fix/issue-3809-session32-serialization-persistence
Feb 9, 2026
Merged

Fix Zip Slip vulnerability, regex recompilation, and redundant hashCode#3810
guiyanakuang merged 1 commit intomainfrom
fix/issue-3809-session32-serialization-persistence

Conversation

@guiyanakuang
Copy link
Copy Markdown
Member

Closes #3809\n\n## Summary\n- S32-01 (HIGH): Add path traversal validation in CompressUtils.unzip() to prevent Zip Slip attacks — resolved paths are checked against the canonical target directory before writing\n- S32-02 (LOW): Move regex in OpenGraphService.extractFromJsonLd() to a companion object constant to avoid recompilation on every call\n- S32-03 (LOW): Remove redundant inherited field hashing/comparison in PasteFileCoordinate and PasteFileInfoTreeCoordinate hashCode()/equals()super.hashCode()/super.equals() already covers inherited fields\n\n## Test plan\n- [ ] Verify unzip() rejects zip entries with path traversal (e.g., ../../malicious.txt)\n- [ ] Verify Open Graph image extraction still works for URLs with JSON-LD\n- [ ] Verify paste coordinate equality/hashing works correctly in file sync operations\n\n🤖 Generated with Claude Code\nvia Happy

…Code

- Add path traversal validation in CompressUtils.unzip() to prevent
  Zip Slip attacks from crafted zip entries
- Move regex to companion object in OpenGraphService.extractFromJsonLd()
  to avoid recompilation on every call
- Remove redundant inherited field hashing/comparison in
  PasteFileCoordinate and PasteFileInfoTreeCoordinate hashCode()/equals()

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@guiyanakuang guiyanakuang merged commit 0a9b182 into main Feb 9, 2026
2 checks passed
@guiyanakuang guiyanakuang deleted the fix/issue-3809-session32-serialization-persistence branch February 9, 2026 04:03
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.

Zip Slip vulnerability, regex recompilation, and redundant hashCode in serialization/persistence layer

1 participant