Skip to content

fix: the url encoding function uses sprintf without ... in pdfrects.c#4

Open
orbisai0security wants to merge 1 commit into
sgerwk:masterfrom
orbisai0security:fix-v002-buffer-overflow-url-encoding
Open

fix: the url encoding function uses sprintf without ... in pdfrects.c#4
orbisai0security wants to merge 1 commit into
sgerwk:masterfrom
orbisai0security:fix-v002-buffer-overflow-url-encoding

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix high severity security issue in pdfrects.c.

Vulnerability

Field Value
ID V-002
Severity HIGH
Scanner multi_agent_ai
Rule V-002
File pdfrects.c:1795

Description: The URL encoding function uses sprintf without bounds checking to write percent-encoded characters into a buffer. Each special character in a filename expands from 1 byte to 3 bytes (e.g., space becomes %20). If the output buffer was not allocated to account for worst-case 3x expansion, the sprintf calls will write beyond the buffer boundary, corrupting adjacent heap memory.

Changes

  • pdfrects.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by OrbisAI Security
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.

1 participant