Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Hardening unpatchable pfSense systems against PHP2Shell via Squid (Target-Specific Fix)

    Scheduled Pinned Locked Moved Cache/Proxy
    squidsecurityfirewalling
    6 Posts 3 Posters 931 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonathanLeeJ
      JonathanLee
      last edited by JonathanLee

      Hi fellow Netgate community members,

      If you are running an older, locked branch of pfSense or pfSense Plus and cannot immediately upgrade the base firmware to patch the recent PHP2Shell vulnerabilities (CVE-2026-109618 / CVE-2026-109619), your system is vulnerable if an attacker can reach your PHP backend.

      Even if you restrict your WebGUI access to specific admin IPs via standard firewall rules, running Squid as a proxy (port 3128) directly on the firewall creates a critical side-channel bypass loop. A malicious actor on your local network could manually route an HTTP request through the proxy targeting your router's IP or loopback address (http://127.0.0.1:YOUR_ADMIN_PORT). Because the connection originates locally from Squid (localhost), your standard interface-based firewall IP restrictions will be bypassed, allowing the PHP exploit payload to reach your WebGUI.

      If you use an auto-proxy (WPAD) setup that forces legitimate management traffic to go direct, the only traffic attempting to proxy into your admin ports is likely an invasive attack.

      Here is a target-specific Squid ACL block that completely neutralizes the exploit path across the proxy without breaking standard internet multi-part file uploads (like email attachments or photo uploads) for your everyday proxy clients.

      The Fix:

      Navigate to Services > Squid Proxy Server, go to the General tab, scroll down to Advanced Features / Custom Options, and paste this block at the very top of the text area (above your other rules so it executes first):
      text

      # --- Target-Specific PHP2Shell Mitigation ---
      # 1. Map your local firewall management IPs and Loopback
      acl This_Firewall_IPs dst 127.0.0.1
      # REPLACE with your actual firewall interface IPs (IPv4 and IPv6 GUA)
      acl This_Firewall_IPs dst 192.168.1.1
      acl This_Firewall_IPs dst 2001:db8::1
      
      # 2. Catch-all for Link-Local IPv6 addresses (fe80::/10) to block side-channels
      acl Link_Local_v6 dst fe80::/10
      acl ULA_Subnets dst fc00::/7
      
      # 3. Target your custom WebGUI ports and match the multipart exploit pattern
      # REPLACE 8080 with your specific custom WebGUI ports if you changed them
      acl WebGUI_Admin_Ports port 8080
      acl PHP2Shell_Payload req_header Content-Type -i multipart/form-data
      
      # 4. Block multipart exploits targeting the firewall interfaces or Link-Local space
      http_access deny PHP2Shell_Payload This_Firewall_IPs
      http_access deny PHP2Shell_Payload Link_Local_v6
      http_access deny PHP2Shell_Payload ULA_Subnets
      http_access deny PHP2Shell_Payload WebGUI_Admin_Ports
      
      # 5. Block regular proxy access to these admin ports entirely
      http_access deny WebGUI_Admin_Ports
      Use code with caution.
      

      Why this works:

      1. It treats the rules as an AND statement. If a user uploads files to the public internet, Squid allows it. If a multi-part upload hits your local firewall IPs or WebGUI ports, it drops it instantly.

      2. Rule 5 acts as an absolute wall. Even over encrypted HTTPS (where Squid can't read the inner multipart header without SSL-Bump), Squid sees the raw CONNECT port destination and drops the connection entirely before a TLS handshake can finish.

      Hopefully this helps anyone else stuck on an unpatchable branch keep their environment locked down! I am just waiting for the mpcie driver to work again for the wifi card or nvme adapter I use. So I am stuck right now.

      Make sure to upvote

      1 Reply Last reply
      Reply Quote 0
      • JonathanLeeJ
        JonathanLee
        last edited by

        please comment if you see anything incorrect, I added ULA addresses also to the catch all

        acl ULA_Subnets dst fc00::/7
        

        Make sure to upvote

        1 Reply Last reply
        Reply Quote 0
        • JonathanLeeJ JonathanLee referenced this topic
        • E
          elvisimprsntr
          last edited by elvisimprsntr

          Rule #1: Don't deploy deprecated or unsupported software.

          What is holding back from updating to a supported version? If you are relying on device specific drivers, then you should choose a different platform that has native supported hardware.

          Seems like a better investment of one’s time.

          JonathanLeeJ 1 Reply Last reply
          Reply Quote 2
          • JonathanLeeJ
            JonathanLee @elvisimprsntr
            last edited by JonathanLee

            @elvisimprsntr
            The intent of this post is to provide a practical, target-specific mitigation for environments running Squid alongside legacy software stacks. Newer pfSense branches already include updated Squid packages that natively resolve these vulnerabilities that prompted the original "deprecation", so an upgrade isn't the issue there, but the new PHP2Shell issue still could be.

            While upgrading the base OS is always the ideal security posture, real-world hardware lifecycles and driver regressions mean migrations take time. The constraint here is strictly hardware compatibility. The 2100-MAX, for example, relies on some specific drivers that are currently unsupported in newer software versions—the mpcie drivers for the older Wi-Fi card as well as the custom mPCIE-to-NVMe hardware adapter driver no longer work and create kernel panic issues. Upgrading at this stage would cause a critical loss of core functionality, rendering a system I paid for entirely useless for its intended deployment and creating more needless e-waste by way of code, not function. The whole system would go down; open-source software at its core has many customized versions with many users doing different things, so the assumption that everyone uses "vanilla" configurations simply isn't true—pfSense is vast and highly customizable. Imagine telling a custom PC builder they have to strip out their hardware adapters just because it wasn't the default configuration on the box.

            This custom ACL block is a stop-gap security advisory. It completely neutralizes the localized side-channel exploit path, keeping legacy networks shielded while long-term hardware migrations or alternative driver solutions are evaluated. If you don't have anything constructive to contribute to the actual ACL logic or the mitigation itself, feel free to sit this one out. The goal here is less e-waste, as it's a driver issue. I need that driver to work before I can move forward, as well as the SafeXcel driver.

            Make sure to upvote

            E 1 Reply Last reply
            Reply Quote 1
            • tinfoilmattT
              tinfoilmatt LAYER 8
              last edited by

              I'm with the resident Squid SME and proud 2100-MAX Everything Bagel Edition owner on this one.

              block out log on { ix0 } inet from any to any
              block out log on { ix0 } inet6 from any to any

              1 Reply Last reply
              Reply Quote 1
              • E
                elvisimprsntr @JonathanLee
                last edited by

                @JonathanLee said in Hardening unpatchable pfSense systems against PHP2Shell via Squid (Target-Specific Fix):

                The 2100-MAX, for example, relies on some specific drivers that are currently unsupported in newer software versions—the mpcie drivers for the older Wi-Fi card as well as the custom mPCIE-to-NVMe hardware adapter driver no longer work and create kernel panic issues. Upgrading at this stage would cause a critical loss of core functionality, rendering a system I paid for entirely useless for its intended deployment and creating more needless e-waste by way of code, not function.

                Sounds like Negate did not adequately regression test new releases against current products.

                1 Reply Last reply
                Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • First post
                  Last post
                Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                Privacy Policy · Cookie Policy