Skip to content
SQL injection Write-up Advanced

Hacking into your Network: Arbitrary Database Write via CSRF

SuiteCRM 7.11.4 contains a SQL injection in the Campaigns module that can be triggered via CSRF, allowing an attacker to write arbitrary data to the database. This database write can then be chained with a PHP object injection to achieve remote code execution on the internal server.

blog.ripstech.com

Published on blog.ripstech.com

As part of our efforts to make the open source web application space more secure we scanned SuiteCRM 7.11.4 with our static code analysis tool RIPS and we detected multiple critical vulnerabilities. Among them is a SQL Injection that can be exploited as a normal user (CVE-2019-12598), which can be leveraged into a…

The author, on blog.ripstech.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application blindly assigns user-supplied request parameters to object properties, including the table name used in SQL queries, without proper validation or sanitisation.

Impact

An attacker could gain full control of the internal server, but the attack requires the victim to be logged in and to visit a malicious page, and the SQL injection alone is limited to database writes.

What the attacker needed

Victim is logged into SuiteCRM; victim visits a malicious website; attacker can send requests to internal SuiteCRM

How it was found

  1. The attacker crafts a malicious URL targeting the WizardNewsletterSave action with parameters that set the table name and other fields.
  2. The attacker lures a logged-in employee to a website that embeds an image pointing to that URL, causing the victim's browser to send the request.
  3. The request triggers a SQL INSERT query that writes attacker-controlled data into the database.
  4. The attacker inserts a row into the inbound_email table containing a serialized malicious PHP object.
  5. The attacker sends a second request to the EmailUIAjax action with a parameter that causes the stored object to be deserialized.
  6. The deserialized object executes code that creates a shell file on the server, achieving remote code execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report describes two linked security flaws in a customer relationship management (CRM) system. First, an attacker can trick a logged-in employee into visiting a malicious website, which secretly sends a request to the CRM and lets the attacker insert data into its database. Second, by inserting a specially crafted piece of data, the attacker can make the CRM run harmful code on the server, giving them full control.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.