CVE-2026-78002: Rsyslog: rsyslog: denial of service via heap buffer overflow in rainerscript replace() function

Published Aug 21, 2026
·
Updated

A flaw was found in rsyslog. An unauthenticated remote attacker can trigger a heap buffer overflow in the RainerScript replace() function by sending specially crafted syslog messages. This vulnerability arises from an incorrect buffer size calculation during string replacement, causing memory corruption. Successful exploitation can lead to a denial of service (DoS) for the affected system.

Other sources

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 esnewStr() 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.

Red Hat

Affected Software

1 affected component
rsyslog Rsyslog

Event History

Aug 21, 2026
Data Sourced
via Red Hat·07:43 PM
DescriptionSeverityAffected Software
Aug 27, 2026
CVE Published
via MITRE·04:12 PM
Data Sourced
via MITRE·04:12 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:20 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What must an attacker be able to do to trigger the flaw?

The attacker must be able to send specially crafted syslog messages to the affected rsyslog instance. No authentication or user interaction is required.

2

Which configurations are exposed?

Exposure requires use of the RainerScript replace() function on attacker-influenced message content, such as message properties including $msg or $rawmsg. The overflow occurs when a failed partial match is followed one byte later by a match that is replaced with a string longer than the search string.

3

What is the expected impact of successful exploitation?

Successful exploitation can corrupt heap memory and cause a denial of service for the affected system. The provided information describes availability impact, not confidentiality or integrity impact.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203