Sebezhetőség a Linux kernelben, amely lehetővé teszi a csak olvasásra elérhető fájlok eltorzítását.

A Linux kernel vulnerability (CVE-2022-0847) has been identified that allows overwriting the contents of the page cache for any files, including those in read-only mode, opened with the O_RDONLY flag, or located on filesystems mounted as read-only. Practically, the vulnerability can be exploited to inject code into arbitrary processes or corrupt data in opened files. For example, it can change the contents of the authorized_keys file for the sshd process. A prototype exploit is available for testing.

The issue has been assigned the code name Dirty Pipe, similar to the critical vulnerability Dirty COW identified in 2016. It is noted that Dirty Pipe poses a danger level comparable to Dirty COW but is significantly easier to exploit. The vulnerability was discovered following reports of periodic corruption of network-loaded files in a system that loads compressed archives from a log server (37 corruptions over 3 months on a heavily loaded system), during which the splice() operation and unnamed pipes were used.

The vulnerability manifests starting from Linux kernel 5.8, released in August 2020, meaning it is present in Debian 11 but does not affect the base kernel in Ubuntu 20.04 LTS. RHEL 8.x and openSUSE/SUSE 15 kernels are based on older branches, but it is possible that the problematic change has been backported into them (exact information is not yet available). Updates on package releases in the distributions can be followed on the following pages: Debian, SUSE, Ubuntu, RHEL, Fedora, Gentoo, Arch Linux. The vulnerability has been fixed in releases 5.16.11, 5.15.25, and 5.10.102. The fix is also included in the kernel used on the Android platform.

The vulnerability is caused by the lack of initialization of the 'buf->flags' value in the code of the copy_page_to_iter_pipe() and push_pipe() functions, given that memory is not cleared when allocating the structure, and due to certain manipulations with unnamed pipes, 'buf->flags' can contain a value from another operation. Using this characteristic, an unprivileged local user can cause the PIPE_BUF_FLAG_CAN_MERGE flag to appear, which allows overwriting data in the page cache by simply writing new data to a specially prepared unnamed pipe.

A támadáshoz a célfájlnak olvashatónak kell lennie, mivel a pipe-ba történő íráskor nem ellenőrzik a hozzáférési jogokat, a weboldal gyorsítótárában való csere akár olyan fájlok esetében is végbe mehet, amelyek csak olvasásra vannak csatolva (például CD-ROM-on lévő fájlok esetében). Az oldal gyorsítótárának információjának lecserélése után az eljárás a fájl adatainak olvasásakor nem a tényleges, hanem a hamisított adatokat kapja meg.

A kihasználás lényege egy névtelen csatorna létrehozása és annak tetszőleges adatokkal való feltöltése, hogy elérjük a PIPE_BUF_FLAG_CAN_MERGE jelző beállítását az összes kapcsolódó gyűrűs struktúrában. Ezt követően az adatokat olvassák a csatornából, de a jelző továbbra is be van állítva az összes pipe_buffer struktúra esetében a gyűrűs pipe_inode_info struktúrákban. Ezt követően a splice() hívás történik a célfájlból a névtelen csatornába történő adatolvasáshoz, a szükséges eltolással kezdve. Amikor adatokat írnak a névtelen csatornába, a PIPE_BUF_FLAG_CAN_MERGE jelző miatt az adatok a weboldal gyorsítótárában felülíródnak, ahelyett, hogy új pipe_buffer struktúra példányt hoznának létre.

Forrás: opennet.ru

Megbízható hosting vásárlása weboldalak számára, DDoS védelemmel, VPS VDS szerverek. 🔥 Megbízható webtárhely vásárlása DDoS védelemmel, VPS VDS szerverek | ProHoster