compose: add bounds checks when parsing malformed translation files#750
compose: add bounds checks when parsing malformed translation files#750orbisai0security wants to merge 2 commits into
Conversation
Automated security fix generated by OrbisAI Security
|
I had also already found this using scrutineer. It's not really a security issue, but it could become a very annoying crash, so we definitely should have this fixed. |
|
Thanks, that makes sense. I’m happy to reframe this as a robustness/crash fix rather than a high-severity security issue. The core issue I was trying to address is that malformed or truncated translation files can cause out-of-bounds reads during AppStream compose parsing. Even if this is not realistically exploitable in the project’s threat model, rejecting malformed input before the memcpy / uint32 read should avoid crashes on bad .mo/.qm files. I’ll update the PR title and description to remove the HIGH severity/security wording and describe it as defensive bounds checking for malformed translation files. |
|
Please try to fix the CI failure as well: |
this is addressed. |
Summary
Add defensive bounds checks when parsing gettext
.moand Qt.qmtranslation files inasc-utils-l10n.c.Motivation
Malformed or truncated translation files can currently cause out-of-bounds reads while parsing translation metadata during AppStream compose processing. This is better framed as a robustness/crash-prevention issue rather than a high-severity security vulnerability.
Changes
AscLocaleGettextHeaderbefore copying it..qmsection length.Notes
This is intended as defensive hardening for malformed input and to avoid crashes during compose processing.
Description: The gettext .mo file parser at compose/asc-utils-l10n.c performs memcpy operations without validating that the source data buffer is large enough. At line 131, it copies sizeof(AscLocaleGettextHeader) bytes without checking the data buffer length. At line 224, it reads 4 bytes at an offset without validating that offset+4 is within bounds. A truncated or malformed .mo file triggers out-of-bounds reads from heap memory.
Changes
compose/asc-utils-l10n.cVerification
Automated security fix by OrbisAI Security