Post

musl libc fixes integer overflows in regular-expression compilation

Several integer overflows in musl’s regcomp can produce undersized allocations and out-of-bounds heap writes when an application compiles a sufficiently large or complex untrusted regular expression. The maintainer says a predictable crash is possible and code execution may be possible depending on the application; the issue affects musl 0.5.0 through 1.2.6. Apply the posted patch or upgrade to 1.2.7 when available, and avoid compiling untrusted patterns until then.

The small Lobsters discussion mostly clarified that regex APIs are part of POSIX libc; commenters noted that libc implementations have exposed them for decades.