Blind SQL Injection in SLiMS 8.3.1 OAI Endpoint

Incident Analysis

Summary

SLiMS 8.3.1 contains a SQL injection issue in the OAI endpoint, specifically through the resumptionToken parameter on /oai2.php. The issue can be validated through blind SQL injection behavior, where true and false SQL conditions produce different response characteristics.

In a real compromise scenario, this type of bug can become more than a database issue. Once the vulnerable query path is abused, an attacker may be able to modify application data, take over an administrator account, and continue into post-exploitation through the admin panel.

Root cause: unauthenticated SQL injection in /oai2.php?verb=ListRecords&resumptionToken=...

Affected Version

The confirmed affected version is SLiMS 8.3.1. The vulnerable behavior exists in the OAI endpoint implementation, where the resumptionToken value can influence backend SQL logic.

I only mark 8.3.1 as confirmed because that is the version validated with the PoC. Other SLiMS 8 releases may share similar code paths, especially if the OAI handler was unchanged, but they should be tested separately before making a version-range claim.

In short:

  • Confirmed vulnerable: SLiMS 8.3.1
  • Vulnerable endpoint: /oai2.php
  • Vulnerable parameter: resumptionToken
  • Vulnerability class: unauthenticated SQL injection
  • Observed technique: boolean-based behavior and stacked-query abuse

Exploitation Path

The vulnerable OAI endpoint accepted a crafted resumptionToken value that allowed SQL logic to be evaluated by the backend. In the observed attack path, the issue was not limited to boolean probing. It was also abused for stacked-query style actions against application data.

Once the database layer was controlled, the attacker could move toward application takeover. The post-exploitation chain then continued through admin access, PHP file placement, and command execution.

The high-level chain looked like this:

  • SQL injection on the public OAI endpoint
  • admin password changed through database modification
  • 2FA disabled for the admin account
  • admin panel access established
  • initial webshell uploaded
  • secondary file manager downloaded
  • privileged command execution prepared
  • persistence attempted
  • root SSH access observed later

PoC Validation

I wrote a Python validator to confirm the SQL injection behavior in an authorized environment. The PoC compared the response profile of a true SQL condition against a false SQL condition, then used the difference as a signal that injected SQL logic was being evaluated by the backend.

This is the sanitized core idea:

def probe(condition):
    token = f"0__AND {condition}__oai_dc"
    response = session.get(
        f"{target}/oai2.php",
        params={"verb": "ListRecords", "resumptionToken": token},
        timeout=15,
    )
    return len(response.content)

true_size = probe("1=1")
false_size = probe("1=2")

if true_size != false_size:
    print("SQL injection behavior confirmed")

The validation output showed a clear response-size gap between a true condition and a false condition. In this run, the true response returned a much larger body than the false response, which confirmed that the injected SQL condition affected backend behavior.

SLiMS 8.3.1 blind SQL injection PoC output

The same validator was also able to retrieve basic database metadata in the authorized test, including the MySQL version, current database name, and database user context. Sensitive target details are redacted in the screenshot.

The internal version also supported time-based checks and controlled database metadata validation. I am not publishing the full extraction workflow or destructive payloads here; the goal was to prove the vulnerability and support remediation, not to release a reusable exploitation tool.

Validation Notes

The finding was validated by correlating:

  • virtual host access logs,
  • suspicious OAI requests,
  • admin login activity shortly after the injection,
  • file creation timestamps,
  • suspicious PHP files in web-accessible directories,
  • command execution traces from a later webshell,
  • and root-level activity after the initial compromise.

The important part was sequence. SQL injection activity appeared before the earliest webshell artifact, which made the webshell an effect of the compromise rather than the original entry point.

Impact

The impact was critical. An unauthenticated attacker could influence SQL execution through a public endpoint, take over an administrator account, and use that access to move deeper into the server.

The practical risks included admin takeover, sensitive database exposure, 2FA bypass through database changes, arbitrary PHP file placement, command execution, persistence, and root-level access.

Remediation

The recommended response was to patch or upgrade SLiMS, validate and sanitize resumptionToken, rotate credentials, reset administrator accounts, re-enable 2FA, remove unknown PHP files, inspect persistence locations, review suspicious binaries, harden web directory permissions, and continue monitoring for repeated access to the same paths.

Cleaning visible webshells alone is not enough. The SQL injection root cause has to be fixed first, followed by a full post-compromise review.

Takeaway

This finding was a good reminder that the loudest artifact is not always the entry point. A webshell is easy to notice, but the real weakness often starts earlier in the application logic.

For me, the valuable part was turning raw indicators into a defensible technical narrative: identify the root cause, prove the sequence, understand the impact, and recommend remediation that addresses the actual source of compromise.