CVE-2026-47142: MantisBT SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-mw6p-33vw-46cc
CWE-89
Published
Advisory Summary

CVE-2026-47142 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting MantisBT libraries in the Packagist ecosystem. The issue involves sql injection via history_order configuration value. Remediation is available by upgrading affected packages to version 2.28.4.

CVE-2026-47142 at a Glance

CVE Identifier CVE-2026-47142
GHSA Identifier GHSA-mw6p-33vw-46cc
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product MantisBT
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-47142

To remediate this vulnerability, upgrade all affected MantisBT dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mantisbt/mantisbt fixed: 2.28.4
Upgrade mantisbt/mantisbt to 2.28.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mantisbt/mantisbt

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-47142, inspect your project dependencies for MantisBT:

inspect dependencies for mantisbt/mantisbt

Analyze the terminal output to locate any version of MantisBT in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.28.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In MantisBT, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

MantisBT 2.28.3 and earlier versions contains a SQL injection vulnerability in core/history_api.php. The history_order configuration value is concatenated directly into a SQL ORDER BY clause without any sanitisation, parameterization, or validation against a whitelist. An administrator can set this configuration value via the web UI (adm_config_set.php) or the REST API (PATCH /api/rest/config). The injected SQL then executes whenever any user views a bug with history entries. ### Impact - Sensitive data extraction from the entire bugtracker database including user credentials (cookie_string, password hashes), API tokens, and private issue data - With MySQL FILE privilege: full RCE via INTO OUTFILE writing a PHP webshell to the web root - The admin plants the payload once; any authenticated user viewing a bug with history triggers the injection ### Patches - https://github.com/mantisbt/mantisbt/commit/6ad20bea2e01f33c6e4170775ae4d9dbe2c75325 ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ ### Resources - https://mantisbt.org/bugs/view.php?id=37123 ### Credits McCaulay Hudson (@McCaulay) of watchTowr

CVE-2026-47142 Affected MantisBT Versions

1 component(s)
Fixed Versions:
2.28.4
Product / Package Ecosystem Affected Versions Fixed Version
mantisbt/mantisbt
Packagist
< 2.28.4
2.28.4

References

Frequently Asked Questions

What is CVE-2026-47142?
CVE-2026-47142 is a security vulnerability in MantisBT involving SQL Injection via history_order Configuration Value under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which MantisBT versions are affected?
Affected versions include releases prior to 2.28.4 across affected packages: mantisbt/mantisbt.
What version fixes CVE-2026-47142?
Upgrading to 2.28.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mantisbt/mantisbt affected?
Yes, mantisbt/mantisbt is affected in releases prior to 2.28.4. Upgrade your dependency to 2.28.4 or later.
What CWE is associated with CVE-2026-47142?
CVE-2026-47142 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2026-47142?
Run the dependency tree command: 'inspect dependencies for mantisbt/mantisbt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mw6p-33vw-46cc",
  "modified" : "2026-07-15T16:38:22Z",
  "published" : "2026-07-15T16:38:22Z",
  "aliases" : [ "CVE-2026-47142" ],
  "summary" : "MantisBT: SQL Injection via history_order Configuration Value",
  "details" : "MantisBT 2.28.3 and earlier versions contains a SQL injection vulnerability in core/history_api.php. The history_order configuration value is concatenated directly into a SQL ORDER BY clause without any sanitisation, parameterization, or validation against a whitelist.\n\nAn administrator can set this configuration value via the web UI (adm_config_set.php) or the REST API (PATCH /api/rest/config). The injected SQL then executes whenever any user views a bug with history entries.\n\n### Impact\n- Sensitive data extraction from the entire bugtracker database including user credentials (cookie_string, password hashes), API tokens, and private issue data\n- With MySQL FILE privilege: full RCE via INTO OUTFILE writing a PHP webshell to the web root\n- The admin plants the payload once; any authenticated user viewing a bug with history triggers the injection\n\n### Patches\n- https://github.com/mantisbt/mantisbt/commit/6ad20bea2e01f33c6e4170775ae4d9dbe2c75325\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n### Resources\n- https://mantisbt.org/bugs/view.php?id=37123\n\n### Credits\nMcCaulay Hudson (@McCaulay) of watchTowr",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mantisbt/mantisbt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.28.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.28.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mantisbt/mantisbt/security/advisories/GHSA-mw6p-33vw-46cc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mantisbt/mantisbt/commit/6ad20bea2e01f33c6e4170775ae4d9dbe2c75325"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mantisbt/mantisbt"
  }, {
    "type" : "WEB",
    "url" : "https://mantisbt.org/bugs/view.php?id=37123"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-15T16:38:22Z",
    "nvd_published_at" : null
  }
}