← back
CVE-2019-13272highunder attack

CVE-2019-13272

100Vexday Risk Score

Patch now. It under exploitation confirmed by CISA and has a working public exploit.

ssvc Actcvss 7.8epss 52%
from disclosure to weapon0 days
Published on NVDJul 17
1st PoCJul 17
metasploitJul 4
CISA KEV+877d
exploitation probability
52%top 1% of all CVEs
observed exploitation
yesCISA + VulnCheck
41 public exploit(s)
Action required by CISAfederal deadline: 2022-06-10

Apply updates per vendor instructions.

Summary

Falha no ptrace do kernel Linux permite que um processo local escale para root explorando o registro incorreto das credenciais usadas para validar uma relação de ptrace criada via PTRACE_TRACEME. É explorável de forma confiável contra o helper pkexec do Polkit, presente por padrão em praticamente todas as distros Linux com desktop, o que torna o impacto prático muito maior do que uma CVE de kernel típica com CVSS 7.8 — está no catálogo KEV da CISA com exploração ativa confirmada e há módulo Metasploit e PoCs públicas.

Technical detail

A função ptrace_link() em kernel/ptrace.c é chamada quando um processo se torna 'tracee' de outro, seja via PTRACE_ATTACH (o tracer inicia) seja via PTRACE_TRACEME (o próprio processo, futuro filho, pede para ser rastreado pelo pai). Essa função grava, junto com o vínculo de ptrace, as credenciais que serão usadas depois para checagens de permissão (ptrace_has_cap / __ptrace_may_access) sempre que o tracer tentar operações privilegiadas sobre o tracee.

How it’s exploited

O bug mora exatamente na fonte de credencial usada nesse registro: no código vulnerável, __ptrace_link() gravava __task_cred(new_parent) sob rcu_read_lock() — a credencial do processo que se tornará tracer, lida em um instante que pode não corresponder ao estado que ela terá quando a relação for de fato usada para validação. O commit de correção (6994eefb0053) troca isso para current_cred(), a credencial do processo que está executando a chamada de fato no momento em que o vínculo é estabelecido, removendo a leitura via RCU. NVD classifica isso como duas falhas combinadas: um problema de lifetime de objeto (que também pode causar panic/DoS) e a marcação incorreta de quando uma relação de ptrace deve ser tratada como privilegiada.

Versions

Affected
Linux kernel anterior a 5.1.17 (a descrição oficial não restringe a um limite inferior específico; distribuições com kernels 4.x com backport do ptrace também foram afetadas, conforme refletido nas erratas de RHEL 7/8).
Fixed in
Linux kernel 5.1.17 e posteriores (mainline). Backports específicos: RHEL 8 kernel/kernel-rt via RHSA-2019:2405 e RHSA-2019:2411; RHEL 7 kernel-alt (4.14.x) via RHSA-2019:2809; Slackware 14.2 conforme advisory publicado; Kernel Live Patch conforme LSN-0054-1.

How to protect

A correção definitiva é atualizar o kernel Linux para 5.1.17 ou posterior, que incorpora o commit 6994eefb0053799d2e07cd140df6c2ea106c41ee (uso de current_cred() em vez de __task_cred() sob RCU). Distribuições enterprise fizeram backport em seus próprios ramos: Red Hat publicou correção via RHSA-2019:2405 e RHSA-2019:2411 (RHEL 8, kernel e kernel-rt) e RHSA-2019:2809 (RHEL 7, kernel-alt); há também Kernel Live Patch (LSN-0054-1) e atualização para Slackware 14.2 — consulte a errata específica da sua distro para o NVR exato do pacote corrigido, já que os números de build (ex.: 4.18.0-80.7.2.rt9.154.el8_0) são amarrados ao ramo/versão de cada distribuição.

How to detect

Como pré-condição, o Polkit's pkexec (ou qualquer suid-binário que faça fork+PTRACE_TRACEME+execve) é o vetor mais citado; disponibilidade do pkexec com kernel vulnerável já configura risco relevante em qualquer distro Linux desktop/server com esse binário instalado. Não há assinatura de rede — é falha 100% local (AV:L), exigindo apenas acesso a shell/execução de código como usuário sem privilégios (PR:L conforme o CVSS informado) e sem interação do usuário.

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.
In the Linux kernel before 5.1.17, ptrace_link in kernel/ptrace.c mishandles the recording of the credentials of a process that wants to create a ptrace relationship, which allows local users to obtain root access by leveraging certain scenarios with a parent-child process relationship, where a parent drops privileges and calls execve (potentially allowing control by an attacker). One contributing factor is an object lifetime issue (which can also cause a panic). Another contributing factor is incorrect marking of a ptrace relationship as privileged, which is exploitable through (for example) Polkit's pkexec helper with PTRACE_TRACEME. NOTE: SELinux deny_ptrace might be a usable workaround in some environments.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected products
n/a · n/a
public PoCs found41 VexDay Proof
exploitdbVexDay Proofwww.exploit-db.com/exploits/47133exploitdbVexDay Proofwww.exploit-db.com/exploits/47543exploitdbwww.exploit-db.com/exploits/47163unverifiedexploitdbwww.exploit-db.com/exploits/50541unverifiedgithubgithub.com/jas502n/CVE-2019-13272332githubgithub.com/Cyc1eC/CVE-2019-132725githubgithub.com/oneoy/CVE-2019-132724githubgithub.com/josemlwdf/CVE-2019-132723githubgithub.com/Tharana/vulnerability-exploitation3githubgithub.com/MDS1GNAL/ptrace_scope-CVE-2019-13272-privilege-escalation2githubgithub.com/Tharana/Exploiting-a-Linux-kernel-vulnerability1githubgithub.com/bigbigliang-malwarebenchmark/cve-2019-132721githubgithub.com/sumedhaDharmasena/-Kernel-ptrace-c-mishandles-vulnerability-CVE-2019-132720githubgithub.com/RashmikaEkanayake/Privilege-Escalation-CVE-2019-13272-0githubgithub.com/Chinmay1743/ptrace-vuln0githubgithub.com/teddy47/CVE-2019-13272---Documentation0githubgithub.com/datntsec/CVE-2019-132720githubgithub.com/GgKendall/secureCodingDemo0githubgithub.com/asepsaepdin/CVE-2019-132720githubgithub.com/polosec/CVE-2019-132720githubgithub.com/babyshen/CVE-2019-132720githubgithub.com/jana30116/CVE-2019-13272-Local-Privilege-Escalation0githubgithub.com/letsr00t/CVE-2019-132720vulncheckvulncheck.com/xdb/98ec350a76a4unverifiedvulncheckvulncheck.com/xdb/e060cd0f389funverifiedcve_referencepacketstormsecurity.com/files/153663/Linux-PTRACE_TRACEME-Broken-Permission-Object-Lifetime-Handling.htmlunverifiedcve_referencepacketstormsecurity.com/files/153702/Slackware-Security-Advisory-Slackware-14.2-kernel-Updates.htmlunverifiedcve_referencepacketstormsecurity.com/files/154245/Kernel-Live-Patch-Security-Notice-LSN-0054-1.htmlunverifiedcve_referencepacketstormsecurity.com/files/154957/Linux-Polkit-pkexec-Helper-PTRACE_TRACEME-Local-Root.htmlunverifiedcve_referencepacketstormsecurity.com/files/156929/Linux-PTRACE_TRACEME-Local-Root.htmlunverifiedcve_referencepacketstormsecurity.com/files/165051/Linux-Kernel-5.1.x-PTRACE_TRACEME-pkexec-Local-Privilege-Escalation.htmlunverifiedvulncheckvulncheck.com/xdb/94bf994e3e35unverifiedvulncheckvulncheck.com/xdb/72cbc61fa5c1unverifiedvulncheckvulncheck.com/xdb/7500952732c6unverifiedvulncheckvulncheck.com/xdb/5581a09e1c77unverifiedvulncheckvulncheck.com/xdb/1df2059c8c67unverifiedvulncheckvulncheck.com/xdb/aebd1e7d7dfeunverifiedvulncheckvulncheck.com/xdb/4cdc3b31592dunverifiedvulncheckvulncheck.com/xdb/a750816d33abunverifiedvulncheckvulncheck.com/xdb/ed71c71d1008unverifiedvulncheckvulncheck.com/xdb/95bb9eeffab4unverified
⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.