CVE-2021-3762
📋 TL;DR
A directory traversal vulnerability in ClairCore allows attackers to write arbitrary files to the filesystem by uploading a malicious container image. This can lead to remote code execution. Organizations using Clair for container vulnerability scanning are affected.
💻 Affected Systems
- Clair
- ClairCore
📦 What is this software?
Clair by Redhat
Clair by Redhat
Quay by Redhat
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with full system compromise, allowing attacker to steal data, deploy malware, or pivot to other systems.
Likely Case
Arbitrary file write leading to service disruption, data corruption, or privilege escalation within the Clair environment.
If Mitigated
Limited impact if Clair runs in isolated container with minimal permissions and network access.
🎯 Exploit Status
Exploitation requires ability to submit container images to Clair for scanning, but no authentication bypass is needed.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Clair v4.1.1+ with ClairCore fixes from PR #478
Vendor Advisory: https://bugzilla.redhat.com/show_bug.cgi?id=2000795
Restart Required: Yes
Instructions:
1. Update Clair to v4.1.1 or later. 2. Update ClairCore dependency to include commit 691f2023a1720a0579e688b69a2f4bfe1f4b7821. 3. Restart Clair service.
🔧 Temporary Workarounds
Restrict Image Sources
allOnly allow Clair to scan images from trusted registries.
Configure Clair config.yaml to whitelist trusted image repositories
Run Clair with Minimal Privileges
linuxRun Clair container with read-only root filesystem and non-root user.
docker run --read-only --user 1001 quay.io/clair
🧯 If You Can't Patch
- Isolate Clair deployment in separate network segment with strict egress filtering.
- Implement image signing verification before allowing images to be scanned by Clair.
🔍 How to Verify
Check if Vulnerable:
Check Clair version: if below v4.1.1 or ClairCore doesn't include commit 691f2023a1720a0579e688b69a2f4bfe1f4b7821, it's vulnerable.
Check Version:
clair --version
Verify Fix Applied:
Verify Clair version is v4.1.1+ and check ClairCore commit hash includes 691f2023a1720a0579e688b69a2f4bfe1f4b7821.
📡 Detection & Monitoring
Log Indicators:
- Unusual file write operations in Clair logs
- Errors from path traversal attempts in scanning logs
Network Indicators:
- Unexpected outbound connections from Clair to external systems
- Large image uploads from untrusted sources
SIEM Query:
source="clair" AND ("path traversal" OR "directory traversal" OR "../" in request)
🔗 References
- https://bugzilla.redhat.com/show_bug.cgi?id=2000795
- https://github.com/quay/clair/pull/1379
- https://github.com/quay/clair/pull/1380
- https://github.com/quay/claircore/commit/691f2023a1720a0579e688b69a2f4bfe1f4b7821
- https://github.com/quay/claircore/pull/478
- https://vulmon.com/exploitdetails?qidtp=maillist_oss_security&qid=d19fce9ede06e13dfb5630ece7f14f83
- https://bugzilla.redhat.com/show_bug.cgi?id=2000795
- https://github.com/quay/clair/pull/1379
- https://github.com/quay/clair/pull/1380
- https://github.com/quay/claircore/commit/691f2023a1720a0579e688b69a2f4bfe1f4b7821
- https://github.com/quay/claircore/pull/478
- https://vulmon.com/exploitdetails?qidtp=maillist_oss_security&qid=d19fce9ede06e13dfb5630ece7f14f83