Trustwave Rapid Response: CrowdStrike Falcon Outage Update. Learn More

Trustwave Rapid Response: CrowdStrike Falcon Outage Update. 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
Offensive Security
Solutions to maximize your security ROI
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

About CVE-2015-8518: SAP Adaptive Server Enterprise Extended Stored Procedure Unauthorized Invocation

SAP released an update for SAP ASE 16.0 and 15.7 that addresses a serious security flaw discovered by Martin Rakhmanov, lead security researcher at Trustwave, that has been around for a long time. Suppose there is a user joe in Adaptive Server Enterprise that can access his database Customers and can create stored procedures within that database. In that case joe can exploit a vulnerability that will create a 'copy' of system extended stored procedure in Customers database and then invoke them. Essentially this means joe can redefine xp_cmdshell system extended stored procedure in Customers for instance and then invoke it. On invocation Adaptive Server Enterprise will trigger execution of real ESP code. Here is a proof-of-concept:

  1. Connect to Adaptive Server Enterprise as joe and switch database context to Customers database

  2. Execute this T-SQL code:

    BSL_12313_e4d74e48-b475-4c75-b112-a60f626e5ada

  3. Now execute xp_cmdshell with some arguments. Note that even though it might fail due to system configuration setting 'xp_cmdshell context', this is still a vulnerability because the setting might be non-default on some systems. Additionally, joe can redefine any other ESP as well.

What did SAP do in the patch to address this issue? Now if we retry the POC against 16.0 SP02 PL01 HF1 there will be an error message given back for the attempt to create ESP in user database:

Msg 2851, Level 16, State 2:
Server '...', Procedure 'xp_cmdshell', Line 1:
Cannot create or replace system extended stored procedure
'xp_cmdshell' in database 'Customers'. Dynamic linked library
'sybsyesp' may only be referenced in 'xp_cmdshell' and 'xp_freedll'
system extended stored procedures created by the database owner of
'sybsystemprocs'.

Adaptive Server Enterprise versions having a fix for this issue: 15.7 SP136 and 16.0 SP02 PL01 HF1. Note that there will be no fix for unsupported versions (12.5, 15.0, 15.5).

SAP security note: https://websmp230.sap-ag.de/sap/support/notes/2240755

Trustwave security advisory: TWSL2015-023

As usual, Trustwave database security products protect your databases against this and many other threats: please update to the latest version of AppDetectivePro/DbProtect knowledgebase to get latest detection logic.

Latest SpiderLabs Blogs

Cloudy with a Chance of Hackers: Protecting Critical Cloud Workloads

If you've been following along with David's posts, you'll have noticed a structure to the topics: Part I: The Plan, Part II: The Execution and now we move into Part III: Security Operations. Things...

Read More

Trustwave Rapid Response: CrowdStrike Falcon Outage Update

Trustwave is proactively assessing and monitoring our clients who may have been impacted by CrowdStrike’s recently rolled-out update for its Windows users. The critical issue identified with...

Read More

Using AWS Secrets Manager and Lambda Function to Store, Rotate and Secure Keys

When working with Amazon Web Services (AWS), we often find that various AWS services need to store and manage secrets. AWS Secrets Manager is the go-to solution for this. It's a centralized service...

Read More