← back
CVE-2022-0847highunder attackCWE-665

CVE-2022-0847

100Vexday Risk Score

Patch now. It under exploitation confirmed by CISA, has a working public exploit and 1 threat group(s) use it.

ssvc Actcvss 7.8epss 89%
from disclosure to weapon0 days
Published on NVDMar 7
1st PoCMar 30
metasploitFeb 20
CISA KEV+49d
exploitation probability
89%top 1% of all CVEs
observed exploitation
yesCISA + VulnCheck
1 group(s)175 public exploit(s)
Who exploits it1

Groups known to exploit this vulnerability (MITRE ATT&CK attribution).

Action required by CISAfederal deadline: 2022-05-16

Apply updates per vendor instructions.

Summary

Dirty Pipe é uma falha de inicialização incompleta no subsistema de pipes do kernel Linux que permite a um usuário local sem privilégios sobrescrever dados em páginas do page cache de arquivos somente leitura — incluindo arquivos pertencentes a root, binários SUID e montagens read-only. O impacto prático é escalada de privilégios trivial e confiável, sem necessidade de condição de corrida, o que a torna mais fácil de explorar que a Dirty COW (CVE-2016-5195), sua prima espiritual de 2016.

Technical detail

A falha está nas funções copy_page_to_iter_pipe e push_pipe, usadas quando o kernel cria novos buffers dentro de um pipe. O campo "flags" da struct pipe_buffer não era reinicializado ao alocar um novo buffer nessas rotinas, herdando valores obsoletos de um uso anterior do mesmo buffer. Especificamente, a flag PIPE_BUF_FLAG_CAN_MERGE — que indica que dados podem ser "mesclados" (escritos) diretamente numa página já existente no pipe — podia permanecer ativa por engano.

O problema (CWE-665, Improper Initialization) foi introduzido no kernel 5.8, quando a lógica de splice/pipe foi reescrita para usar referências de página em vez de cópias, uma mudança de performance que eliminou uma verificação implícita de permissão de escrita. Como a flag CAN_MERGE não distingue se a página no pipe é uma cópia interna ou uma referência direta a uma página do page cache de um arquivo em disco, o kernel aceita uma escrita nessa página sem validar se o arquivo subjacente é gravável pelo processo chamador.

O atacante controla o conteúdo escrito e o deslocamento dentro do arquivo-alvo (dentro dos limites do que splice() permite manipular), desde que consiga fazer com que uma página do arquivo termine referenciada dentro de um pipe cujo buffer tenha a flag indevidamente setada. Não há uso de memória fora de limites nem corrupção de estruturas do kernel — é puramente um erro de controle de acesso disfarçado de bug de inicialização.

How it’s exploited

A exploração é local, não requer autenticação privilegiada (PR:L no vetor reflete apenas a necessidade de uma conta local qualquer) e não exige interação de outro usuário. O pré-requisito real é: acesso de shell (ou execução de código) na máquina, kernel dentro da faixa vulnerável, e permissão de leitura sobre o arquivo-alvo — não é necessário poder escrever nele, essa é justamente a garantia que a falha quebra. Mecanicamente, o ataque usa uma sequência de chamadas envolvendo pipes e splice() para forçar um buffer de pipe a referenciar uma página do page cache do arquivo-alvo com a flag de merge indevidamente ativa, e então escrever nesse buffer — a escrita se propaga para a página real do arquivo em disco/cache.

Na prática documentada por pesquisadores e por provas de conceito públicas, isso foi usado para modificar arquivos de sistema protegidos (como /etc/passwd), sequestrar binários SUID substituindo seu conteúdo por um payload controlado pelo atacante, e obter shell como root. A CISA lista a falha no catálogo KEV por exploração confirmada in-the-wild, e existe módulo Metasploit e múltiplos PoCs funcionais publicados poucos dias após a divulgação — a barreira técnica para exploração é baixa uma vez que se tem qualquer acesso local, incluindo containers mal isolados e ambientes Android (que usam kernels Linux e frequentemente ficam atrás no patch level).

A falha não afeta arquivos que o kernel bloqueia por outros mecanismos (ex.: proteções de imutabilidade via chattr +i, ou montagens com opções específicas que impedem mmap gravável), mas a maioria dos sistemas em produção não usa essas proteções como padrão.

Versions

Affected
Linux kernel a partir da versão 5.8 até, mas não incluindo, 5.16.11, 5.15.25 e 5.10.102 (a falha foi introduzida na reescrita do subsistema de pipe/splice na série 5.8 e permaneceu presente em todos os ramos estáveis subsequentes até a correção).
Fixed in
5.16.11, 5.15.25 e 5.10.102 (mainline). Ramos anteriores ao 5.10 (ex.: LTS mais antigos) não são afetados por não conterem a reescrita introduzida na 5.8. Distribuições realizaram backports próprios para seus kernels empacotados — verificar o changelog de segurança da distribuição específica para a versão de pacote corrigida.

How to protect

A correção definitiva é atualizar o kernel. O fornecedor (mantenedores do kernel Linux) corrigiu a falha nas versões 5.16.11, 5.15.25 e 5.10.102, com backports subsequentes feitos por cada distribuição (RHEL, Ubuntu, Debian, SUSE, e fabricantes de dispositivos Android via boletins de segurança). Não existe flag de configuração, parâmetro de sysctl ou opção de montagem que neutralize a falha sem patch — é um bug de lógica no caminho de código do pipe, não um recurso que pode ser desativado seletivamente.

Como paliativo real na ausência de patch imediato, é possível restringir a superfície reduzindo quem pode executar splice()/vmsplice() via seccomp-bpf ou perfis de LSM (AppArmor/SELinux) customizados, mas isso tem custo operacional alto: splice é usado por ferramentas comuns (netcat, proxies, containers) e bloqueá-lo pode quebrar funcionalidade. Monitoramento de integridade de arquivos (AIDE, Tripwire) sobre binários SUID e arquivos críticos de sistema serve como detecção compensatória, não como prevenção.

Mito a descartar: reiniciar serviços, remontar filesystems como read-only no nível de bloco, ou usar contêineres sem privilégios não elimina o risco — a falha está no kernel do host e afeta qualquer processo com acesso de leitura ao arquivo, independentemente de namespaces, exceto quando o isolamento de kernel entre host e convidado é real (máquinas virtuais completas, não apenas containers compartilhando kernel).

How to detect

Como o vetor é puramente local e a exploração ocorre inteiramente em memória via chamadas de sistema padrão (pipe, splice, vmsplice, write), não há assinatura de rede e a maioria dos PoCs não deixa rastro óbvio em logs de aplicação. O sinal mais confiável é comportamental: monitoramento de syscalls via auditd/eBPF observando sequências atípicas de splice()/vmsplice() por processos não privilegiados seguidas de escrita em arquivos aos quais o processo não deveria ter permissão de gravação, e verificação de integridade (hash) de binários SUID e arquivos de sistema críticos para detectar modificação retroativa.

Na ausência dessas instrumentações, não há sinal confiável — é preciso assumir exposição com base na versão do kernel em uso, não em evidência de log.

Researched and written with AI from the vendor advisory and public analysis, with the sources above. Always confirm the fixed version in the official advisory before acting.
A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe and push_pipe functions in the Linux kernel and could thus contain stale values. An unprivileged local user could use this flaw to write to pages in the page cache backed by read only files and as such escalate their privileges on the system.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected products
n/a · kernel
public PoCs found175
exploitdbwww.exploit-db.com/exploits/50808unverifiedgithubgithub.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit1129githubgithub.com/AlexisAhmed/CVE-2022-0847-DirtyPipe-Exploits728githubgithub.com/r1is/CVE-2022-0847282githubgithub.com/Al1ex/CVE-2022-084791githubgithub.com/DataDog/dirtypipe-container-breakout-poc77githubgithub.com/basharkey/CVE-2022-0847-dirty-pipe-checker70githubgithub.com/ZZ-SOCMAP/CVE-2022-084758githubgithub.com/bbaranoff/CVE-2022-084750githubgithub.com/febinrev/dirtypipez-exploit49githubgithub.com/knqyf263/CVE-2022-084746githubgithub.com/greenhandatsjtu/CVE-2022-0847-Container-Escape37githubgithub.com/airbus-cert/dirtypipe-ebpf_detection29githubgithub.com/chenaotian/CVE-2022-084725githubgithub.com/ahrixia/CVE_2022_084721githubgithub.com/breachnix/dirty-pipe-poc15githubgithub.com/0xIronGoat/dirty-pipe14githubgithub.com/LudovicPatho/CVE-2022-0847_dirty-pipe10githubgithub.com/crusoe112/DirtyPipePython10githubgithub.com/xndpxs/CVE-2022-08479githubgithub.com/crowsec-edtech/Dirty-Pipe9githubgithub.com/rexpository/linux-privilege-escalation9githubgithub.com/h4ckm310n/CVE-2022-0847-eBPF8githubgithub.com/qwert419/linux-7githubgithub.com/drapl0n/dirtypipe7githubgithub.com/Mustafa1986/CVE-2022-0847-DirtyPipe-Exploit6githubgithub.com/arttnba3/CVE-2022-08476githubgithub.com/4luc4rdr5290/CVE-2022-08476githubgithub.com/KianaBin/CVE-2022-0847-Container-Escape5githubgithub.com/nanaao/dirtyPipe-automaticRoot4githubgithub.com/DanaEpp/pwncat_dirtypipe4githubgithub.com/gyaansastra/CVE-2022-08473githubgithub.com/Shotokhan/cve_2022_0847_shellcode3githubgithub.com/EagleTube/CVE-2022-08473githubgithub.com/sa-infinity8888/Dirty-Pipe-CVE-2022-08473githubgithub.com/bluedragonsecurity/Linux-Kernel-Dirty-Pipe-Exploitation-Logic-Bug-3githubgithub.com/eduquintanilha/CVE-2022-0847-DirtyPipe-Exploits3githubgithub.com/MrP1xel/CVE-2022-0847-dirty-pipe-kernel-checker3githubgithub.com/mhanief/dirtypipe2githubgithub.com/rabomen/Dirty-Pipe2githubgithub.com/Gustavo-Nogueira/Dirty-Pipe-Exploits2githubgithub.com/puckiestyle/CVE-2022-08472githubgithub.com/mutur4/CVE-2022-08472githubgithub.com/JlSakuya/CVE-2022-0847-container-escape2githubgithub.com/0xeremus/dirty-pipe-poc2githubgithub.com/dadhee/CVE-2022-0847_DirtyPipeExploit2githubgithub.com/zzzchuu/Dirty-Pipe2githubgithub.com/karanlvm/DirtyPipe-Exploit2githubgithub.com/byteReaper77/Dirty-Pipe2githubgithub.com/CYB3RK1D/CVE-2022-0847-POC2githubgithub.com/jpts/CVE-2022-0847-DirtyPipe-Container-Breakout2githubgithub.com/tmoneypenny/CVE-2022-08472githubgithub.com/cspshivam/CVE-2022-0847-dirty-pipe-exploit2githubgithub.com/VinuKalana/DirtyPipe-CVE-2022-08472githubgithub.com/ihenakaarachchi/debian11-dirty_pipe-patcher2githubgithub.com/xiaoLvChen/CVE-2022-08471githubgithub.com/muhammad1596/CVE-2022-0847-dirty-pipe-checker1githubgithub.com/mattlloyddavies/ps-lab-cve-2022-08471githubgithub.com/pashayogi/DirtyPipe1githubgithub.com/joeymeech/CVE-2022-0847-Exploit-Implementation1githubgithub.com/mrchucu1/CVE-2022-0847-Docker1githubgithub.com/b4dboy17/Dirty-Pipe-Oneshot1githubgithub.com/lucksec/CVE-2022-08471githubgithub.com/ITMarcin2211/CVE-2022-0847-DirtyPipe-Exploit1githubgithub.com/realbatuhan/dirtypipetester1githubgithub.com/Mephierr/DirtyPipe_exploit1githubgithub.com/scopion/dirty-pipe1githubgithub.com/gladiator-07/CVE-2022-08470githubgithub.com/si1ent-le/CVE-2022-08470githubgithub.com/bohr777/cve-2022-0847dirtypipe-exploit0githubgithub.com/Greetdawn/CVE-2022-0847-DirtyPipe0githubgithub.com/nanaao/Dirtypipe-exploit0githubgithub.com/AyoubNajim/cve-2022-0847dirtypipe-exploit0githubgithub.com/pentestblogin/pentestblog-CVE-2022-08470githubgithub.com/babyshen/CVE-2022-08470githubgithub.com/edsonjt81/CVE-2022-0847-Linux0githubgithub.com/V0WKeep3r/CVE-2022-0847-DirtyPipe-Exploit0githubgithub.com/osungjinwoo/CVE-2022-0847-Dirty-Pipe0githubgithub.com/Greetdawn/CVE-2022-0847-DirtyPipe-0githubgithub.com/githublihaha/DirtyPIPE-CVE-2022-08470githubgithub.com/stfnw/Debugging_Dirty_Pipe_CVE-2022-08470githubgithub.com/0xr1l3s/CVE-2022-08470githubgithub.com/tufanturhan/CVE-2022-0847-L-nux-PrivEsc0githubgithub.com/CPT-Jack-A-Castle/CVE-2022-08470githubgithub.com/isaiahsimeone/COMP3320-VAPT0githubgithub.com/jxpsx/CVE-2022-0847-DirtyPipe-Exploits0githubgithub.com/notl0cal/dpipe0githubgithub.com/edsonjt81/CVE-2022-0847-DirtyPipe-0githubgithub.com/DataFox/CVE-2022-08470githubgithub.com/pmihsan/Dirty-Pipe-CVE-2022-08470githubgithub.com/ajith737/Dirty-Pipe-CVE-2022-0847-POCs0githubgithub.com/orsuprasad/CVE-2022-0847-DirtyPipe-Exploits0githubgithub.com/jonathanbest7/cve-2022-08470githubgithub.com/ayushx007/CVE-2022-0847-dirty-pipe-checker0githubgithub.com/ayushx007/CVE-2022-0847-DirtyPipe-Exploits0githubgithub.com/solomon12354/LockingGirl-----CVE-2022-0847-Dirty_Pipe_virus0githubgithub.com/letsr00t/CVE-2022-08470githubgithub.com/xsxtw/CVE-2022-08470githubgithub.com/muhammad1596/CVE-2022-0847-DirtyPipe-Exploits0githubgithub.com/aswanepo/DirtyPipe0githubgithub.com/JustinYe377/CTF-CVE-2022-08470githubgithub.com/mithunmadhukuttan/Dirty-Pipe-Exploit0githubgithub.com/RogelioPumajulca/CVE-2022-08470githubgithub.com/cypherlobo/DirtyPipe-BSI0githubgithub.com/morgenm/dirtypipe0githubgithub.com/Scouserr/cve-2022-0847-poc-dockerimage0githubgithub.com/Shadow-Spinner/CVE-2022-08470githubgithub.com/honeyvig/CVE-2022-0847-DirtyPipe-Exploit0githubgithub.com/stfnw/reproducer-poc-CVE-2022-08470githubgithub.com/SimoesCTT/Chrono-Drip-Temporal-Viscosity-Exploitation-Framework-CVE-2022-08470githubgithub.com/real-tim-johnston/megaquagga-pentest-report0githubgithub.com/JeevanAnand1202/Penetration-Test0githubgithub.com/gaganhm3018-art/CVE-2022-0847-Dirty-Pipe-0githubgithub.com/t1ckprivate/CVE-2022-0847-Dirty-Pipe0vulncheckvulncheck.com/xdb/fd2f2968f48cunverifiedvulncheckvulncheck.com/xdb/2d68d5611e4bunverifiedvulncheckvulncheck.com/xdb/138c1f528926unverifiedcve_referencepacketstormsecurity.com/files/166229/Dirty-Pipe-Linux-Privilege-Escalation.htmlunverifiedvulncheckvulncheck.com/xdb/e2dbb982b5daunverifiedvulncheckvulncheck.com/xdb/5753c6aff2e2unverifiedvulncheckvulncheck.com/xdb/df0bacb0b7bcunverifiedvulncheckvulncheck.com/xdb/4a62a2a669beunverifiedvulncheckvulncheck.com/xdb/11089b6096c2unverifiedvulncheckvulncheck.com/xdb/8d1294672787unverifiedvulncheckvulncheck.com/xdb/bef271559611unverifiedvulncheckvulncheck.com/xdb/a3b3ce85d0a5unverifiedvulncheckvulncheck.com/xdb/5a77169c0797unverifiedvulncheckvulncheck.com/xdb/42ba5e95ff5bunverifiedvulncheckvulncheck.com/xdb/c4258f9dc626unverifiedvulncheckvulncheck.com/xdb/57ffde1c1df6unverifiedvulncheckvulncheck.com/xdb/5e1cd4381cd2unverifiedvulncheckvulncheck.com/xdb/8fecaa2db7c9unverifiedvulncheckvulncheck.com/xdb/7681898c4d58unverifiedvulncheckvulncheck.com/xdb/e4ea692dc95eunverifiedvulncheckvulncheck.com/xdb/bc3dc26b7001unverifiedvulncheckvulncheck.com/xdb/a76c9b8da62aunverifiedvulncheckvulncheck.com/xdb/46be9d6ea639unverifiedvulncheckvulncheck.com/xdb/86e89699a34aunverifiedvulncheckvulncheck.com/xdb/4876d153c69aunverifiedvulncheckvulncheck.com/xdb/54b99f9179fbunverifiedvulncheckvulncheck.com/xdb/c735aeb744eaunverifiedvulncheckvulncheck.com/xdb/d6a71047f04cunverifiedvulncheckvulncheck.com/xdb/d34eb7cc4235unverifiedvulncheckvulncheck.com/xdb/79c51557e8e7unverifiedvulncheckvulncheck.com/xdb/b7ade02a3da0unverifiedvulncheckvulncheck.com/xdb/830e350bd642unverifiedvulncheckvulncheck.com/xdb/6c64ccbb8d52unverifiedvulncheckvulncheck.com/xdb/27ac660f03deunverifiedvulncheckvulncheck.com/xdb/96d8ebedfe2funverifiedvulncheckvulncheck.com/xdb/6651072dd4a6unverifiedvulncheckvulncheck.com/xdb/610fa05f7ec4unverifiedvulncheckvulncheck.com/xdb/a77a7570c91bunverifiedvulncheckvulncheck.com/xdb/b665c30d7b05unverifiedvulncheckvulncheck.com/xdb/17eac3a8349dunverifiedvulncheckvulncheck.com/xdb/de3da6925a66unverifiedvulncheckvulncheck.com/xdb/e74c2b6094acunverifiedvulncheckvulncheck.com/xdb/d542c059ef55unverifiedvulncheckvulncheck.com/xdb/d3a70ff7bafdunverifiedvulncheckvulncheck.com/xdb/370b7021f8a9unverifiedvulncheckvulncheck.com/xdb/d3ad03153f6eunverifiedvulncheckvulncheck.com/xdb/0ff57a4fbafcunverifiedvulncheckvulncheck.com/xdb/39fa7f44daa8unverifiedvulncheckvulncheck.com/xdb/82740f737207unverifiedvulncheckvulncheck.com/xdb/a83519a93931unverifiedvulncheckvulncheck.com/xdb/cbca31fa2346unverifiedvulncheckvulncheck.com/xdb/986760f90254unverifiedvulncheckvulncheck.com/xdb/7f2dbb1be2faunverifiedvulncheckvulncheck.com/xdb/7a4fbe4458fbunverifiedvulncheckvulncheck.com/xdb/f44fe86cdbd8unverifiedcve_referencepacketstormsecurity.com/files/176534/Linux-4.20-KTLS-Read-Only-Write.htmlunverifiedcve_referencepacketstormsecurity.com/files/166258/Dirty-Pipe-Local-Privilege-Escalation.htmlunverifiedvulncheckvulncheck.com/xdb/3b34006b6ed8unverifiedcve_referencepacketstormsecurity.com/files/166230/Dirty-Pipe-SUID-Binary-Hijack-Privilege-Escalation.htmlunverifiedvulncheckvulncheck.com/xdb/8700be3bde3funverifiedvulncheckvulncheck.com/xdb/d2e7f7cbb621unverified
⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.