<div dir="ltr">Package: policykit-1<div>Version: 0.105-26</div><div><br></div><div>Dear Maintainer,<br><br>I noticed that there is an out-of-bounds read at the following source location:<br><br><a href="https://salsa.debian.org/utopia-team/polkit/-/blob/debian/0.105-26/src/polkitbackend/polkitbackendactionpool.c#L1127">https://salsa.debian.org/utopia-team/polkit/-/blob/debian/0.105-26/src/polkitbackend/polkitbackendactionpool.c#L1127</a><br><br>There is also a potential out-of-bounds write a few lines below in the same file (line 1131).<br><br>The bug happens when the locale string is longer than 256 characters. It happens because strncpy does not insert a terminating null byte ('\0') when the source string is too long. This means that the loop can read off the end of the string, and potentially write out-of-bounds on line 1131.<br><br>The bug can be triggered by an unprivileged user sending an EnumerateActions D-Bus message to polkitd. (I have attached a PoC.)<br><br>Although an out-of-bounds read/write is a potential security issue, in practice my PoC does not cause polkitd to crash. That's because there are usually some zero bytes on the stack (in the memory above lang2) which prevent it from hitting anything important. In other words, this bug is technically a security issue, but it is very low severity.<br><br>Weirdly, this bug only exists on the version of polkit used by Debian. It was fixed 7 years ago in the main polkit repo:<br><br><a href="https://gitlab.freedesktop.org/polkit/polkit/-/commit/facadfb5c8c52ba45fd20ffe3b6d3ddd4208a427">https://gitlab.freedesktop.org/polkit/polkit/-/commit/facadfb5c8c52ba45fd20ffe3b6d3ddd4208a427</a><br><br>The bug is also fixed in policykit-1 version 0.116-2, which is the version used by Debian experimental. But versions 0.105-15~deb8u4 to 0.105-26, which are the versions used by the other Debian releases, contain the bug.<br><br>Despite the low severity of the bug, I would recommend cherry-picking commit facadfb5c8c52ba45fd20ffe3b6d3ddd4208a427 onto all of your releases to fix it.<br><br>Thank you,<br><br>Kevin Backhouse<br>GitHub Security Lab<br></div></div>