Skip to content

Fix Heap-based buffer overflow & integer overflow - #240

Merged
lategoodbye merged 4 commits into
rscada:masterfrom
lategoodbye:overflow
Aug 25, 2026
Merged

Fix Heap-based buffer overflow & integer overflow#240
lategoodbye merged 4 commits into
rscada:masterfrom
lategoodbye:overflow

Conversation

@lategoodbye

Copy link
Copy Markdown
Collaborator

This pull request fix some heap-based buffer overflows and integer overflow in the output buffer allocation. Finally all bad usage of snprintf is fixed.

Thanks to Brian Willows (brian@graith.co.uk) and Adam Bedard (Security
Researcher) for reporting

The realloc threshold was lower than the possible output of
mbus_data_variable_record_xml(), which could result in a buffer overflow.

Thanks to Brian Willows (brian@graith.co.uk) and Adam Bedard (Security
Researcher) for reporting.

While at this reduce the result buffer of mbus_data_variable_header_xml()
and mbus_data_variable_header_xml().
There was no limit for the XML output buffer, which could result in a
integer overflow of 'buff_size'.
Since the return value of snprintf is counterintuitive, make sure
the result is stored within an integer and check for all error cases
before using it as buffer index.
Since the return value of snprintf is counterintuitive, make sure
the result is stored within an integer and check for all error cases
before using it as buffer index.
@lategoodbye
lategoodbye merged commit 76c2443 into rscada:master Aug 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant