Bug 2524995 - CVE-2026-78002 rsyslog: rsyslog: Denial of service via heap buffer overflow in RainerScript replace() function [fedora-all]
Summary: CVE-2026-78002 rsyslog: rsyslog: Denial of service via heap buffer overflow i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rsyslog
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Attila Lakatos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["001ecaf7-7f6a-4a73-8c99-1...
Depends On:
Blocks: CVE-2026-78002
TreeView+ depends on / blocked
 
Reported: 2026-08-27 15:44 UTC by Marco Benatto
Modified: 2026-09-18 13:59 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-09-18 13:59:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Marco Benatto 2026-08-27 15:44:04 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

doFuncReplace() in grammar/rainerscript.c implements replace(source, find, replaceWith) as two passes over the source string: pass 1 computes the output length, pass 2 allocates that many bytes with
es_newStr() and fills them. On partial-match failure the two passes rewind by different amounts — pass 1 does i -= (j - 1), pass 2 does i -= j — so pass 1 resumes scanning at matchStart + 2 while pass 2 resumes at matchStart + 1. Every match that begins one byte after a failed partial match is therefore counted by pass 2 but not by pass 1. When replaceWith is longer than find, each such match makes the allocation short by lReplaceWith - lfind bytes, and pass 2 writes past the end of the buffer. Neither store site is bounds-checked. The source string is normally a message property ($msg, $rawmsg, …), so an unauthenticated remote syslog sender chooses the number of missed matches and thus the size of the overflow.

Comment 1 Attila Lakatos 2026-09-18 13:59:58 UTC
Fixed in current release https://koji.fedoraproject.org/koji/buildinfo?buildID=3104235


Note You need to log in before you can comment on or make changes to this bug.