CVE-2021-3907
📋 TL;DR
OctoRPKI has a path traversal vulnerability where malicious repositories can write files outside the designated cache directory using '..' sequences in URIs. This allows attackers to potentially achieve remote code execution on systems running OctoRPKI. Affected users are those running vulnerable versions of OctoRPKI that fetch from untrusted repositories.
💻 Affected Systems
- OctoRPKI
- cfrpki
📦 What is this software?
Octorpki by Cloudflare
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data theft, and lateral movement within the network.
Likely Case
Arbitrary file write to sensitive locations, potentially enabling privilege escalation or persistence mechanisms.
If Mitigated
Contained file writes limited to cache directory with no system impact.
🎯 Exploit Status
Exploitation requires control over repository content but is straightforward once achieved.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: v1.4.0 and later
Vendor Advisory: https://github.com/cloudflare/cfrpki/security/advisories/GHSA-3jhm-87m6-x959
Restart Required: Yes
Instructions:
1. Stop OctoRPKI service. 2. Update to v1.4.0 or later via package manager or source. 3. Restart OctoRPKI service.
🔧 Temporary Workarounds
Restrict Repository Sources
allOnly allow connections to trusted, verified repositories
# Configure OctoRPKI to use only trusted rsync sources in configuration
Filesystem Restrictions
linuxRun OctoRPKI in container or with restricted filesystem permissions
# Run with AppArmor/SELinux profiles
# Use chroot jail or container isolation
🧯 If You Can't Patch
- Isolate OctoRPKI instances in network segments with no internet access
- Implement strict egress filtering to allow only trusted repository connections
🔍 How to Verify
Check if Vulnerable:
Check OctoRPKI version: if < v1.4.0, system is vulnerable
Check Version:
octorpki --version
Verify Fix Applied:
Confirm version is v1.4.0 or later and test with safe path traversal payload
📡 Detection & Monitoring
Log Indicators:
- Unusual file write patterns outside cache directory
- Repository URIs containing '..' sequences
Network Indicators:
- Connections to unknown/untrusted rsync repositories
SIEM Query:
source="octorpki.log" AND (uri="*../*" OR path="*/../*")
🔗 References
- https://github.com/cloudflare/cfrpki/security/advisories/GHSA-3jhm-87m6-x959
- https://github.com/cloudflare/cfrpki/security/advisories/GHSA-cqh2-vc2f-q4fh
- https://www.debian.org/security/2021/dsa-5033
- https://www.debian.org/security/2022/dsa-5041
- https://github.com/cloudflare/cfrpki/security/advisories/GHSA-3jhm-87m6-x959
- https://github.com/cloudflare/cfrpki/security/advisories/GHSA-cqh2-vc2f-q4fh
- https://www.debian.org/security/2021/dsa-5033
- https://www.debian.org/security/2022/dsa-5041