/

CVE-2026-25239

Severity:

HIGH RISK

(7.5)

SQL Injection in PEAR API Documentation Queue Insertion

CVE-2026-25239

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise via SQL Injection

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection vulnerability in PEAR's API documentation queue insertion logic allows an attacker who can influence the filename value to manipulate database queries.

Under these conditions, crafted input can alter the intended SQL command, potentially exposing or modifying data in the backing database.

Affected context

This vulnerability affects applications and build/documentation systems that use PEAR (prior to 1.33.0) and rely on its API documentation queue feature.

It becomes relevant when user-controlled or externally supplied values are used as the filename parameter feeding into the queue insertion logic without proper sanitization or parameterization.

Typical scenarios include automated documentation generation, upload or import processes, or integrations where filenames are derived from HTTP requests, CLI input, or other untrusted sources.

Exploit preconditions

  • Attack surface: Any code path that enqueues API documentation jobs via PEAR, where the filename parameter is influenced by untrusted input.
  • Required access: Ability to supply or modify the filename value (e.g., via web forms, upload endpoints, API parameters, or automated tooling configuration).
  • Trigger point: Execution of the SQL query that inserts a new entry into the API documentation queue using the unsafely constructed filename value.
  • Why exploitation is possible: The filename is interpolated directly into an SQL statement (or otherwise not safely parameterized), allowing portions of the query to be altered when special characters and SQL syntax are injected.

Why this happens

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

PEAR's API documentation queue insertion logic relies on dynamically constructed SQL statements that embed the filename value without guaranteed use of prepared statements or safe parameter binding.

When untrusted input can reach this code path, the database interprets parts of the filename as SQL syntax, enabling attackers to modify the query structure—such as altering WHERE clauses, UNIONing additional queries, or terminating and appending new commands—rather than treating the value purely as data.

Potential impact

  • Disclosure of sensitive information from the database that the PEAR process can access.
  • Modification or deletion of queue records and potentially other related tables.
  • Creation of fraudulent or malicious records that affect documentation pipelines or downstream automation.
  • Potential escalation to broader application compromise if the database is tightly coupled with authentication, configuration, or access control data.
  • In extreme cases, execution of database-level commands or stored procedures, depending on DBMS capabilities and privileges.

General mitigation guidance

Effective mitigation centers on enforcing strict separation between data and SQL logic:

  • Use parameterized queries or prepared statements for all database interactions involving filenames or similar external inputs.
  • Apply robust input validation for filename fields, limiting characters to a conservative, well-defined allowlist (e.g., alphanumerics, dots, dashes, underscores) where feasible.
  • Normalize and sanitize file-related values before they are passed to database layers, ensuring that they cannot be interpreted as SQL syntax.
  • Centralize data access logic so that raw SQL construction is minimized and security controls (parameterization, escaping, validation) are consistently applied.
  • Run database accounts with least privilege so that even if a query is manipulated, its ability to affect other schemas or critical tables is limited.

How teams detect issues like this

Detection can combine code-centric and behavior-centric approaches:

  • Static analysis: Configure SAST tools or linters to flag string-concatenated SQL queries, especially those incorporating variables like filenames or other external input.
  • Code review: During peer review, look for direct insertion of external values into SQL strings, missing prepared statements, or custom escaping routines that bypass standard database libraries.
  • Logging and monitoring: Monitor database logs for anomalous queries containing unexpected SQL keywords within filename-related fields, or sudden spikes in failed queries from documentation-related components.
  • Security testing: Incorporate SQL injection test cases into automated integration and QA suites, focusing on interfaces that accept filenames or similar parameters and propagate them into the database.

Sources

SourceLink
github.comgithub.com/pear/pearweb/security/advisories/GHSA-f9mg-x463-3vxg

Frequently asked

questions

It can be, if a remote user or system can supply or influence the filename value that ultimately reaches the API documentation queue insertion logic. In many deployments this occurs via web, API, or automated tooling interfaces.

The attacker must be able to control or significantly influence the filename parameter used when enqueuing API documentation jobs. They do not necessarily need direct database access; control over the upstream input path is sufficient.

Refactor the affected code to use prepared statements or parameterized queries for all database operations involving filenames, and ensure that filenames are strictly validated against a constrained set of allowed characters before reaching the database layer.

Establish a development standard that forbids dynamic SQL concatenation with external input, enforce the use of parameterized queries by default, incorporate static analysis rules for injection patterns, and require security-focused code reviews for any data access code.

Find out what's already
exploitable in your codebase.