Skip to content

fix: programs/_freeze_module in _freeze_module.c#148977

Closed
orbisai0security wants to merge 1 commit intopython:mainfrom
orbisai0security:fix-v-002-sprintf-buffer-overflow
Closed

fix: programs/_freeze_module in _freeze_module.c#148977
orbisai0security wants to merge 1 commit intopython:mainfrom
orbisai0security:fix-v-002-sprintf-buffer-overflow

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix critical severity security issue in Programs/_freeze_module.c.

Vulnerability

Field Value
ID V-002
Severity CRITICAL
Scanner multi_agent_ai
Rule V-002
File Programs/_freeze_module.c:129
CWE CWE-120

Description: Programs/_freeze_module.c:129 uses sprintf(filename, "<frozen %s>", name) where 'name' is the module name argument. If 'name' exceeds the fixed-size filename buffer minus the 9-character surrounding literal '', the buffer overflows. Parser/string_parser.c:185 uses sprintf(p, "\U%08x", chr) where 'p' points into a string buffer whose remaining capacity is not validated before the write. Both calls use the unsafe sprintf() function which performs no bounds checking on the destination buffer.

Changes

  • Programs/_freeze_module.c
  • Parser/string_parser.c

Verification

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

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Apr 25, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Apr 25, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Apr 25, 2026

p has enough size, please don't open PRs without issues, nor without reading the devguide otherwise we will be forced to lock you from contributing to our repositories. See https://devguide.python.org/getting-started/pull-request-lifecycle/.

@picnixz picnixz closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants