adm-zip — библиотека JavaScript для создания и извлечения архивов ZIP в Node.js. До 0.6.1 adm-zip применяет биты разрешения Unix, хранящиеся в zip-записи, непосредственно к извлеченному файлу через fs.chmodSync() когда keepOriginalPermission=true передается в extractAllTo()`/`extractEntryTo(), и он никогда не фильтрует setuid/setgid/sticky бит из этих битов. Таким образом, zip, созданный злоумышленником, может создать извлеченный двоичный файл с режимом 04755.
Когда извлечение выполняется как root (позиция по умолчанию в сборке Docker, бегуны CI и привилегированные шаги установки - точные среды, в которых используется этот флаг), результирующий файл setuid, принадлежащий root, выполняется позже менее привилегированным пользователем, превращая код злоумышленника в root-исполнение. Версия 0.6.1 исправляет проблему.
Показать оригинальное описание (EN)
adm-zip is a JavaScript library for creating and extracting ZIP archives in Node.js. Prior to 0.6.1, adm-zip applies the Unix permission bits stored in a zip entry directly to the extracted file via `fs.chmodSync()` when `keepOriginalPermission=true` is passed to `extractAllTo()`/`extractEntryTo()` — and it never filters the setuid/setgid/sticky bits out of those bits. A zip crafted by an attacker can therefore produce an extracted binary with mode `04755`. When extraction runs as root (the default posture in Docker builds, CI runners, and privileged install steps — the exact environments where this flag is used), the resulting root-owned setuid file is executed later by a lesser-privileged user, turning the attacker's code into a root execution. Version 0.6.1 fixes the issue.
Характеристики атаки
Последствия
Строка CVSS v3.1