what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

SOPHOS WAF JSON Filter Bypass

SOPHOS WAF JSON Filter Bypass
Posted May 27, 2015
Authored by Glaudson Ocampos

SOPHOS WAF fails to mitigate SQL injection attacks leveraged via JSON.

tags | exploit, sql injection, bypass
SHA-256 | 7c4905fd9d75cb2fe8a2a7130f59acfdaf94e04066de14122ac0d354d465b979

SOPHOS WAF JSON Filter Bypass

Change Mirror Download
SECURITYLABS INTELLIGENT RESEARCH - SECURITY ADVISORY
http://www.securitylabs.com.br/


ADVISORY/0115 - SOPHOS WAF (WEBSERVER PROTECTION) DOES NOT ANALYZE JSON DATA


PRIORITY: MEDIUM
TYPE: WAF Bypass


1 - About SecurityLabs Intelligent Research
-----------------------------------------------

SecurityLabs Intelligent Researh is a team specialized in projects of
penetration test(Pentests),
security audits and cryptanalysis.

It has a group of researchers with more than 15 years of experience.

All penetration tests (Pen-Test) conducted by Intruders Tiger Team Security
have 100% of success.
All cryptanalysis and security audits performed by the team were also well
effective.

This vulnerability was discovery during a penetration test.


2 - Introduction
------------------

Sophos Webserver Protection uses mod_security.

From "http://www.modsecurity.org/":

"ModSecurity is a toolkit for real-time web application monitoring,
logging, and access control.
I like to think about it as an enabler: there are no hard rules telling you
what to do; instead,
it is up to you to choose your own path through the available features.
That's why the title of this
section asks what ModSecurity can do, not what it does."

We can see yet from Sophos WebServer Protection Site
(
https://www.sophos.com/en-us/medialibrary/PDFs/factsheets/sophosutmwebserverprotectiondsna.pdf?la=en
):

"Web Application Firewall

Our Web Application Firewall intercepts traffic to your servers to protect
them from
tampering and hacking attempts. It secures your web applications against
more than 350
attack patterns including SQL injection, cross-site scripting and directory
traversal. We also
scan all inbound files and content with our dual antivirus agents to keep
infected content off
your network."



3 - Description
----------------


SecurityLabs Intelligent Research has found some conditions of bypass of
the default signatures of mod_security
on Sophos WebServer Protection(ModSecurity) that allows execution of SQL
Injection attacks in JSON Requests.

Sophos WebServer Protection don't analyze payload when Content-type is JSON.

In default instalation, there is no "requestBodyProcessor" defined to check
HTTP POST REQUEST BODY
when Content-Type is "application/json".


4 - Analysis
---------------

There are several ways to analyze this problem, including hacking
production's environment, but
the simplest way is sent HTTP requests with JSON data in body like this:


POST /[URI] HTTP/1.1
Host: [TARGET]
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101
Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Proxy-Connection: keep-alive
X-Requested-With: XMLHttpRequest
Content-Type: application/json; charset=utf-8
Referer: http://[TARGET]/
Content-Length: 27
Cookie: ASP.NET_SessionId=d0dusce1rrsgx4rvvtwj0br0;
_ga=GA1.3.234022554.1429121838; _gat=1
Pragma: no-cache
Cache-Control: no-cache

{"id":"SQL INJECTION HERE"}


5 - Detection
--------------

SecurityLabs Intelligent Research has found this vulnerability in Sophos
UTM version 9.310.

It is possible that previous versions have the same problem.


6 - Workaround
----------------

Add the follow rule in file
'/var/storage/chroot-reverseproxy/usr/apache/conf/waf/modsecurity_crs_sql_injection_attacks.conf'
to check JSON data
too:

SecRule REQUEST_HEADERS:Content-Type "application/json"
"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=URLENCODED"


7 - Credits
-------------

SecurityLabs Intelligent Research and Glaudson Ocampos
has discovered this vulnerability.


--
Atenciosamente,

Glaudson Ocampos
Pesquisador de Segurança da Informação
SecurityLabs Intelligent Research


Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close