Skip to content

fix: add buffer-length check in unzip.cpp - #429

Open
anupamme wants to merge 1 commit into
NativeScript:mainfrom
anupamme:fix-repo-ios-heap-buffer-overflow-unzip-strcpy
Open

fix: add buffer-length check in unzip.cpp#429
anupamme wants to merge 1 commit into
NativeScript:mainfrom
anupamme:fix-repo-ios-heap-buffer-overflow-unzip-strcpy

Conversation

@anupamme

@anupamme anupamme commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Fix critical severity security issue in TKLiveSync/unzip.cpp.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File TKLiveSync/unzip.cpp:49
Assessment Likely exploitable
CWE CWE-120

Description: A PATH_MAX-sized heap buffer (pathcopy) receives ZIP entry names via strcpy() without bounds checking. ZIP specification allows entry names up to 65535 bytes, far exceeding typical PATH_MAX values (4096 or 1024). This creates a classic buffer overflow where crafted long filenames overflow the heap buffer.

Evidence

Exploitation scenario: Attacker creates a ZIP archive with an entry name longer than PATH_MAX bytes.

Scanner confirmation: multi_agent_ai rule V-001 flagged this pattern.

Production code: This file is in the production codebase, not test-only code.

Threat Model Context

This is a Node.js library - vulnerabilities affect downstream consumers who use this package.

Changes

  • TKLiveSync/unzip.cpp

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 63d4b4ea-b2a8-4f7b-80b5-fea6b6191399

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NathanWalker

Copy link
Copy Markdown
Contributor

Thank you, target main branch instead of dev on this PR.

@anupamme
anupamme changed the base branch from dev to main August 4, 2026 06:01
@anupamme

anupamme commented Aug 4, 2026

Copy link
Copy Markdown
Author

Thank you, target main branch instead of dev on this PR.

done.

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.

2 participants