CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Java Floating Point DoS Attack Protection

As many of you may have heard, there is an interesting Java DoS scenario out -

http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/

http://blog.fortify.com/blog/2011/02/08/Double-Trouble

http://blogs.adobe.com/asset/2011/02/year-of-the-snail.html

When I first saw this issue, I quickly tweeted out a modsec rule that would identify if anyone submitted the example payload being shown in many PoC payloads -

SecRule ARGS|REQUEST_HEADERS "@contains 2.2250738585072012e-308" "phase:2,block,msg:'Java Floating Point DoS Attack',tag:'CVE-2010-4476'"

While this provides some protection, it was by no means comprehensive. Here is an updated ModSecurity ruleset. With the use of the ModSecurity Lua API, we (myself and Josh Zlatin/@Jamuse_ of PureHacking) came up with a new Generation 2 detection mechanism similar to what Brian Sullivan (Adobe) presented.

First step is to inspect the ARGS and REQUEST_HEADERS data using a regex to match on potential floating point or non-scientific notation version payloads -

SecRule ARGS|REQUEST_HEADERS "[0-9\.]{12}e[\-\+][0-9]{1,}|[0-9\.]{324}" \"phase:2,t:none,t:lowercase,nolog,pass,exec:/usr/local/apache/conf/modsec_current/base_rules/FloatingPointDoSAttack.lua"

If a payload is found that matches the regex check, ModSecurity will execute an external Lua script. The lua script then extracts out payloads, strips out the "." and then searches for the MagicDoSNumber. If this is found, then a TX variable is exported -

#!/opt/local/bin/luafunction main() local Pattern = "2225073858507201";  -- Get the ModSec collections  local Headers = m.getvars("REQUEST_HEADERS");  local Args = m.getvars("ARGS");  for i = 1, #Headers do    FilteredPattern,NumChanges=string.gsub(Headers[i].value, "[.]", "")    for j in string.gmatch(FilteredPattern, Pattern) do      m.setvar("tx.floatingpointdos", Headers[i].name)      return ("Potential Floating Point DoS Attack via variable: " ..Headers[i].name ..  ".");    end  end  for i = 1, #Args do    FilteredPattern,NumChanges=string.gsub(Args[i].value, "[.]", "")    for j in string.gmatch(FilteredPattern, Pattern) do      m.setvar("tx.floatingpointdos", Args[i].name)      return ("Potential Floating Point DoS Attack via variable: " ..Args[i].name ..  ".");    end  end  return nil;end

Then we have one follow-up rule that checks if the TX:FLOATINGPOINTDOS variable is set -

SecRule TX:FLOATINGPOINTDOS ".*" "phase:2,t:none,log,block,msg:'Floating Point DoS Payload Found.',logdata:'Location: %{matched_var}',tag:'CVE-2010-4476'"

We have conducted some tests with different payloads and this appears to work pretty well. You can test by using the following curl command (adjust the target URL for your site) -

$ curl -H "Accept-Language: en-us;q=2.2250738585072012e-308" http://localhost/

This should create the following ModSecurity alert -

[Tue Feb 15 12:38:02 2011] [error] [client ::1] ModSecurity: Warning. Pattern match ".*" at TX:floatingpointdos. [file "/usr/local/apache/conf/modsec_current/base_rules/modsecurity_crs_15_customrules.conf"] [line "2"] [msg "Floating Point DoS Payload Found."] [data "Location: REQUEST_HEADERS:Accept-Language"] [tag "CVE-2010-4476"] [hostname "localhost"] [uri "/"] [unique_id "TVq5@sCoqAEAAACvFaYAAAAA"]

If you find any issues please let use know @ModSecurity.

Latest SpiderLabs Blogs

The Secret Cipher: Modern Data Loss Prevention Solutions

This is Part 7 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here. Far too many organizations place Data Loss Prevention (DLP) and Data...

Read More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway

Overview A command injection vulnerability has been discovered in the GlobalProtect feature within Palo Alto Networks PAN-OS software for specific versions that have distinct feature configurations...

Read More

CNAPP, CSPM, CIEM, CWPP – Oh My!

We all know the cybersecurity industry loves its acronyms, but just because this fact is widely known doesn’t mean everyone knows the story behind the alphabet soup groups of letters, we must deal...

Read More