exploit the possibilities
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:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    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