/

CVE-2026-48528

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Metacat REST API Endpoints

CVE-2026-48528

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89, CWE-287

Impact:

Unauthenticated Database Disclosure and Modification

Severity:

CRITICAL RISK

(9.8)

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

Metacat contains an unauthenticated SQL injection vulnerability in the /cn/v1/object and /cn/v2/object REST API endpoints. An attacker may manipulate the nodeId parameter to read, insert, modify, or delete data in the PostgreSQL database, with SQL errors potentially disclosing query results.

Affected context

The vulnerability affects Metacat deployments that expose the /cn REST endpoints and construct backend SQL queries using unsanitized nodeId input. Risk is increased when these endpoints are reachable by untrusted users and when database error details are returned to API callers. Deployments that do not require the Coordinating Node endpoints may have an option to disable them.

Exploit preconditions

  • Attack surface: The /cn/v1/object or /cn/v2/object REST API endpoints
  • Required access: Network access to the affected endpoints; authentication is not required
  • Trigger point: Processing of attacker-controlled data in the nodeId parameter
  • Why exploitation is possible: User input is appended to SQL statements without parameterization, while database errors are reflected in XML responses

Why this happens

The underlying bug is a failure to separate data from executable SQL syntax. Metacat incorporates the user-controlled nodeId value directly into backend queries rather than using parameterized statements or an equivalent safe query abstraction. Detailed SQL errors further create an information-disclosure channel by returning database-generated output to the caller. This behavior maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection); the lack of authentication is also related to CWE-287: Improper Authentication.

Potential impact

  • An unauthenticated attacker may extract protected database information.
  • An attacker could disclose catalog metadata, access logs, identity information, or access-control data.
  • An attacker could insert, alter, or delete records in the Metacat database.
  • Database integrity and the availability of repository services could be affected.
  • Sensitive information may be exposed across connected DataONE infrastructure.

General mitigation guidance

Mitigation should focus on eliminating SQL construction from raw user input and reducing exposure of unnecessary API functionality.

Common defensive patterns include:

  • Use parameterized queries, prepared statements, or a trusted query-builder abstraction for every user-controlled value.
  • Validate nodeId against a strict allowlist or expected data type before it reaches database logic.
  • Return generic client-facing errors while recording detailed database diagnostics only in protected server logs.
  • Disable unused /cn REST endpoints at the web-application or servlet-routing layer.
  • Apply least-privilege permissions to the Metacat database account, separating read and write capabilities where practical.
  • Restrict endpoint access through authentication, authorization, network segmentation, and gateway policy.

How teams detect issues like this

Organizations can look for SQL injection exposure through:

  • Static analysis rules identifying string concatenation or interpolation of request parameters in SQL statements.
  • Code review signals such as database calls built from raw REST parameters and exception details returned in XML or JSON responses.
  • Dynamic testing that uses safe, controlled SQL injection test cases against non-production environments.
  • Web application firewall or API gateway policies monitoring suspicious database operators, malformed parameters, and repeated database-error responses.
  • Log review for unusual /cn endpoint activity, database syntax errors, unexpected query failures, and unauthenticated access patterns.
  • Automated security review tools that flag unsafe query construction and verbose error handling.

Sources

SourceLink
github.comgithub.com/NCEAS/metacat/security/advisories/GHSA-6g6j-wh5h-77h5

Frequently asked

questions

Yes. An attacker generally needs network access to an exposed /cn/v1/object or /cn/v2/object endpoint, but does not need to authenticate.

Depending on database permissions and deployment configuration, an attacker may read sensitive records and may insert, modify, or delete database content.

Ensure all database operations use parameterized queries or equivalent safe abstractions, validate input, suppress detailed database errors in API responses, and remove or restrict endpoints that are not required.

Combine secure query APIs with strict input validation, least-privilege database accounts, authenticated endpoint access, centralized error handling, code review, and automated SQL injection testing.

Find out what's already
exploitable in your codebase.