Fedora Account System
Red Hat Associate
Red Hat Customer
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.
This issue has been addressed in the following products: Red Hat Enterprise Linux 10 Via RHSA-2026:69541 https://access.redhat.com/errata/RHSA-2026:69541
This issue has been addressed in the following products: Red Hat Enterprise Linux 9 Via RHSA-2026:69540 https://access.redhat.com/errata/RHSA-2026:69540
This issue has been addressed in the following products: Red Hat Enterprise Linux 8 Via RHSA-2026:80817 https://access.redhat.com/errata/RHSA-2026:80817
This issue has been addressed in the following products: Red Hat Enterprise Linux 10.0 Extended Update Support Via RHSA-2026:81321 https://access.redhat.com/errata/RHSA-2026:81321
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.6 Extended Update Support Via RHSA-2026:84576 https://access.redhat.com/errata/RHSA-2026:84576
This issue has been addressed in the following products: Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions Via RHSA-2026:86124 https://access.redhat.com/errata/RHSA-2026:86124