Research / LVL0X00-2026-0001
SQL injection in the Metacat 2.x harvester registration servlet
Metacat's harvester registration servlet builds its INSERT and UPDATE statements by string concatenation behind a quoting helper that never escapes, and it accepts any HTTP session without confirming a login. An attacker can run arbitrary SQL, including stacked queries, against the Metacat PostgreSQL database.
- Severity
- Critical 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CVE
- CVE-2026-48114
- Vendor
- NCEAS
- Product
- Metacat
- Affected
- 2.19.1 and earlier
- Fixed in
- 3.0.0
- Class
Overview
Metacat 2.x through 2.19.1 includes a harvester client that lets remote sites register a list of documents for Metacat to collect on a schedule. Its registration servlet, HarvesterRegistration, writes each registration to the HARVEST_SITE_SCHEDULE table with SQL built by string concatenation. The helper used to "quote" each value wraps it in single quotes without escaping anything, so request parameters are injected directly into the statement.
The servlet also accepts any existing HTTP session as proof of login. Combined, these give an attacker arbitrary SQL execution in the Metacat database, including stacked queries.
The harvesterClient package was removed in Metacat 3.0.0 without a security advisory, and the 2.x branch was never patched. NCEAS published GHSA-wrc6-rc34-hrcg for this issue on 27 May 2026.
Affected configurations
Any Metacat deployment below 3.0.0 that exposes the HarvesterRegistration servlet (/harvesterRegistration) is affected. The impact described below assumes the default PostgreSQL backend, whose JDBC driver executes stacked statements passed to Statement.executeUpdate().
Details
doPost() reads the registration fields straight from the request and passes them to dbInsert() for a new registration, or to dbUpdate() for an existing one:
contactEmail = parameterParser.getStringParameter("contactEmail", "None");
documentListURL = parameterParser.getStringParameter("documentListURL", "");
unit = parameterParser.getStringParameter("unit", "days");
dbInsert() concatenates them into the statement:
query = "insert into HARVEST_SITE_SCHEDULE " +
"(SITE_SCHEDULE_ID, CONTACT_EMAIL, DOCUMENTLISTURL, LDAPDN, LDAPPWD, " +
"UNIT, UPDATEFREQUENCY, DATENEXTHARVEST) " +
"values(" + siteScheduleID + "," +
quoteString(contactEmail) + "," +
quoteString(documentListURL) + "," +
quoteString(ldapDN) + "," +
quoteString(ldapPwd) + "," +
quoteString(unit) + "," +
updateFrequency + "," +
quoteString(dateNextHarvest) + ")";
stmt.executeUpdate(query);
The quoting helper adds quotes and nothing else:
private String quoteString(String str) {
return "'" + str + "'";
}
Excerpts from src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java, Metacat 2.19.0, © Regents of the University of California and NCEAS, GPLv2.
A single quote in contactEmail, documentListURL or unit closes the string literal, and the rest of the value is interpreted as SQL. dbUpdate() builds its UPDATE statements the same way.
The only gate in front of this code is a check that an HTTP session exists:
httpSession = req.getSession(false);
if (httpSession == null) {
System.out.println("User did not log in.");
return;
}
ldapDN = (String) httpSession.getAttribute("username");
The servlet never confirms that the session came from a successful login through HarvesterRegistrationLogin, so it does not establish a real LDAP identity before running the statement.
NCEAS's advisory also describes a second-order injection in the same feature: the scheduled harvester fetches the attacker-supplied documentListURL, and the <scope> element parsed from that document reaches SQL unsanitized.
Impact
The statements run with the Metacat database account, which owns the application's data. An attacker can read and modify every table, including user and session data, stored credentials and the xml_documents corpus of metadata records, and can run further statements of their choosing through stacked queries.
Proof of concept
The injection was confirmed against Metacat 2.19.0 by submitting a registration field that closes the string literal and appends attacker-controlled SQL, after which the database contents were enumerated. Request payloads are not included in this write-up.
Remediation
Upgrade to Metacat 3.0.0 or later, preferably the current 3.x release. The 2.x branch will not receive a fix.
If an upgrade is not immediately possible, NCEAS recommends removing the servlet and servlet-mapping entries for the harvester servlets (HarvesterServlet, HarvesterRegistrationLogin, HarvesterRegistration) and the OAI-PMH OAIHandler from Tomcat's web.xml, then restarting Tomcat. See GHSA-wrc6-rc34-hrcg for the full configuration.
Disclosure timeline
- Discovered with William Wallace (fjord.ai) during an authorized security assessment
- Reported privately to the Metacat maintainers by email, proposing 30 days before public disclosure
- Maintainers confirmed the issue
- Offered to review the draft advisories
- GitHub, acting as CNA, reserved CVE-2026-48114
- Maintainers published GitHub advisory GHSA-wrc6-rc34-hrcg
- CVE record and NVD entry published. CISA assessment: exploitation none, automatable yes, technical impact total
- Advisory published
References
Revision history
- Initial publication
Machine-readable: LVL0X00-2026-0001.json