{"answers":{"affected":"","exploited":"There is no known exploitation of CVE-2025-40271 in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"CVE-2025-40271 is a high-severity use after free vulnerability in Linux, published on 6 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-40271 and fix it if it is affected.\n\nWhat it is: CVE-2025-40271 is a high-severity use after free vulnerability in Linux, published on 6 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-40271 in the wild and no public exploit code.\n\nAffected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-40271/ (Markdown: https://insights.sbomify.com/CVE-2025-40271/index.md)","id":"CVE-2025-40271","markdown":"https://insights.sbomify.com/CVE-2025-40271/index.md","name":"CVE-2025-40271","record":{"aliases":["BELL-CVE-2025-40271","DEBIAN-CVE-2025-40271","GHSA-r37x-wmxh-7hvh","ROOT-OS-DEBIAN-12-CVE-2025-40271","ROOT-OS-DEBIAN-13-CVE-2025-40271","ROOT-OS-UBUNTU-2204-CVE-2025-40271","ROOT-OS-UBUNTU-2404-CVE-2025-40271","UBUNTU-CVE-2025-40271"],"analysis":{"component_type":"kernel","fix_type":"patch","impacts":["code_execution","privilege_escalation"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Linux kernel","requires_auth":"low_privilege","summary":"A use-after-free vulnerability in the Linux kernel's proc filesystem allows local attackers to potentially execute arbitrary code or escalate privileges via race conditions.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Linux","cpe":[],"cvss":{"score":7.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[],"description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/proc: fix uaf in proc_readdir_de()\n\nPde is erased from subdir rbtree through rb_erase(), but not set the node\nto EMPTY, which may result in uaf access.  We should use RB_CLEAR_NODE()\nset the erased node to EMPTY, then pde_subdir_next() will return NULL to\navoid uaf access.\n\nWe found an uaf issue while using stress-ng testing, need to run testcase\ngetdent and tun in the same time.  The steps of the issue is as follows:\n\n1) use getdent to traverse dir /proc/pid/net/dev_snmp6/, and current\n   pde is tun3;\n\n2) in the [time windows] unregister netdevice tun3 and tun2, and erase\n   them from rbtree.  erase tun3 first, and then erase tun2.  the\n   pde(tun2) will be released to slab;\n\n3) continue to getdent process, then pde_subdir_next() will return\n   pde(tun2) which is released, it will case uaf access.\n\nCPU 0                                      |    CPU 1\n-------------------------------------------------------------------------\ntraverse dir /proc/pid/net/dev_snmp6/      |   unregister_netdevice(tun-\u003edev)   //tun3 tun2\nsys_getdents64()                           |\n  iterate_dir()                            |\n    proc_readdir()                         |\n      proc_readdir_de()                    |     snmp6_unregister_dev()\n        pde_get(de);                       |       proc_remove()\n        read_unlock(\u0026proc_subdir_lock);    |         remove_proc_subtree()\n                                           |           write_lock(\u0026proc_subdir_lock);\n        [time window]                      |           rb_erase(\u0026root-\u003esubdir_node, \u0026parent-\u003esubdir);\n                                           |           write_unlock(\u0026proc_subdir_lock);\n        read_lock(\u0026proc_subdir_lock);      |\n        next = pde_subdir_next(de);        |\n        pde_put(de);                       |\n        de = next;    //UAF                |\n\nrbtree of dev_snmp6\n                        |\n                    pde(tun3)\n                     /    \\\n                  NULL  pde(tun2)","ecosystems":[],"exploits":{"exploitdb":1,"first_seen":"2026-05-04","github_poc":2,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-06-30T18:40:57Z","kind":"github_poc","ref":"https://github.com/MadExploits/CVE-2025-40271","stars":1,"title":"CVE-2025-40271 Modifed By MadEploits"},{"date":"2026-05-04","kind":"exploitdb","ref":"52550","stars":null,"title":"Linux Kernel proc_readdir_de() 6.18-rc5 - Local Privilege Escalation"},{"date":"2026-05-04T16:10:40Z","kind":"github_poc","ref":"https://github.com/kaleth4/CVE-2025-40271","stars":0,"title":null}],"tier":"poc_unverified"},"has_fix":true,"headline":"fs/proc: fix uaf in proc_readdir_de()","id":"CVE-2025-40271","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"use_after_free","year":"2025"},"n_packages":0,"n_references":8,"next":{"headline":"mm/secretmem: fix use-after-free race in fault handler","id":"CVE-2025-40272"},"packages":[],"prev":{"headline":"mm, swap: fix potential UAF issue for VMA readahead","id":"CVE-2025-40270"},"products":["Linux"],"published":"2025-12-06","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"GPL-2.0-or-later","name":"Exploit-DB"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-08-05","vendors":["Linux"]},"summary":"A use-after-free vulnerability in the Linux kernel's proc filesystem allows local attackers to potentially execute arbitrary code or escalate privileges via race conditions.","url":"https://insights.sbomify.com/CVE-2025-40271/"}