Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-27017 Overview
CVE-2025-27017 is an information disclosure vulnerability in Apache NiFi affecting versions 1.13.0 through 2.2.0. The flaw causes MongoDB components to record authentication credentials inside NiFi provenance events during data flow processing. Any authorized user with read access to those provenance events can retrieve the stored username and password for the connected MongoDB instance. The issue is tracked under CWE-538: Insertion of Sensitive Information into Externally-Accessible File or Directory. Apache NiFi 2.3.0 resolves the vulnerability by excluding credentials from provenance records.
Critical Impact
Authorized NiFi users with provenance read access can harvest plaintext MongoDB credentials, enabling lateral movement into connected database infrastructure.
Affected Products
- Apache NiFi 1.13.0 through 1.x releases
- Apache NiFi 2.0.0 through 2.2.0
- Deployments using MongoDB processors (PutMongo, GetMongo, PutMongoRecord, and related components)
Discovery Timeline
- 2025-03-12 - CVE-2025-27017 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-27017
Vulnerability Analysis
Apache NiFi records provenance events to document how data moves through processors. These events capture processor attributes, routing decisions, and configuration context used during execution. In affected releases, MongoDB processors wrote their connection credentials into provenance event records as part of the processor execution metadata.
Provenance data is designed to be queryable by operators and auditors through the NiFi UI and REST API. Users granted the read provenance policy on affected processors could therefore read MongoDB usernames and passwords embedded in historical event records. The exposure persists for the configured retention period of the provenance repository, meaning credentials remain recoverable long after the originating flow executed.
Root Cause
The root cause is improper handling of sensitive connection attributes when MongoDB components emit provenance events. The components did not redact or exclude authentication parameters before serializing event metadata to the provenance repository. This matches the [CWE-538] pattern of placing sensitive information into a location accessible to users who should not possess it.
Attack Vector
Exploitation requires an authenticated NiFi account with provenance read privileges on a MongoDB processor. The attacker queries provenance events through the NiFi UI or the /nifi-api/provenance REST endpoint, filters for events generated by MongoDB components, and reads the credential fields from the returned event attributes. No network-level exploitation of MongoDB itself is needed to retrieve the credentials.
The vulnerability is described in prose only. See the Apache Security Mailing List Post and Openwall OSS Security Discussion for the vendor's advisory text.
Detection Methods for CVE-2025-27017
Indicators of Compromise
- Provenance queries targeting MongoDB processors by authenticated users outside normal administrative workflows
- Unusual access to the /nifi-api/provenance REST endpoint with filters referencing PutMongo, GetMongo, or PutMongoRecord
- Successful MongoDB logins from hosts that are not registered NiFi worker nodes using credentials assigned to NiFi flows
Detection Strategies
- Audit NiFi access policies to enumerate every principal holding view provenance rights on MongoDB processors
- Review provenance repository records on affected versions for literal credential strings in event attributes before upgrading or purging
- Correlate NiFi user activity logs with MongoDB authentication logs to identify out-of-band credential reuse
Monitoring Recommendations
- Enable NiFi audit logging and ship events to a centralized analytics platform for query review
- Alert on provenance search operations that return large result sets filtered by MongoDB processor types
- Monitor MongoDB authentication sources and flag logins from unexpected client IP addresses using NiFi service accounts
How to Mitigate CVE-2025-27017
Immediate Actions Required
- Upgrade Apache NiFi to version 2.3.0 or later, which removes credentials from MongoDB provenance records
- Rotate every MongoDB credential configured in NiFi flows on affected versions, assuming prior exposure
- Restrict the view provenance and view the data policies on MongoDB processors to a minimal set of administrators
- Purge or truncate the provenance repository after rotation to remove historical credential copies
Patch Information
The Apache NiFi project resolved CVE-2025-27017 in release 2.3.0. Full advisory text is published in the Apache Security Mailing List Post. Operators running the 1.x branch should migrate to the 2.3.0 release line, as the fix is not backported to the 1.x stream.
Workarounds
- Replace static MongoDB credentials with short-lived credentials sourced from a secrets manager so exposed values expire quickly
- Reduce the provenance repository retention period to minimize the window during which leaked credentials remain recoverable
- Remove the view provenance policy from non-administrative NiFi roles until the upgrade is completed
# Example: tighten provenance retention in nifi.properties
nifi.provenance.repository.max.storage.time=24 hours
nifi.provenance.repository.max.storage.size=1 GB
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

