We actively support the following versions with security updates:
| Version | Supported |
|---|---|
| 1.x.x | ✅ |
| < 1.0 | ❌ |
We take security vulnerabilities seriously. If you discover a security issue, please follow these steps:
Please do not report security vulnerabilities through public GitHub issues. This helps prevent malicious actors from exploiting the vulnerability before a fix is available.
Report the vulnerability privately through one of these methods:
-
GitHub Security Advisories (Preferred):
- Go to the Security tab
- Click "Report a vulnerability"
- Fill out the form with details
-
Direct Email:
- Contact the maintainer through GitHub
- Use the subject line:
[SECURITY] Brief description of vulnerability
Please include:
- Description of the vulnerability
- Steps to reproduce the issue
- Potential impact (e.g., data exposure, code execution)
- Affected versions
- Suggested fix (if you have one)
- Your contact information for follow-up
Example Report:
**Vulnerability Type:** Arbitrary Code Execution
**Description:**
The model loading function uses `torch.load()` without checking file
integrity, allowing malicious actors to embed arbitrary code in
pretrained weight files.
**Steps to Reproduce:**
1. Create malicious .pth file with embedded code
2. Load using `model.load_weights('malicious.pth')`
3. Arbitrary code executes during unpickling
**Impact:**
High - Could lead to remote code execution on user machines
**Affected Versions:**
All versions <= 1.0.0
**Suggested Fix:**
Use `torch.load(..., weights_only=True)` in PyTorch 2.0+
or verify checksums before loading- Initial Response: Within 48 hours
- Status Update: Within 7 days
- Fix Timeline: Varies by severity
- Critical: Emergency patch within 7 days
- High: Patch within 30 days
- Medium: Patch within 90 days
- Low: Next regular release
- We follow coordinated disclosure
- Security advisories will be published after a fix is available
- You will be credited (unless you prefer anonymity)
- We aim for a 90-day disclosure window
# ✅ SAFE: Use weights_only for PyTorch 2.0+
model.load_state_dict(
torch.load('model.pth', weights_only=True)
)
# ❌ UNSAFE: Default loading can execute arbitrary code
model.load_state_dict(
torch.load('untrusted_model.pth') # Dangerous!
)# Always verify checksums for downloaded models
sha256sum pretrained_model.pth
# Compare with published checksumRun untrusted models in isolated environments:
# Use Docker for isolation
docker run --rm -it \
--gpus all \
-v $(pwd):/workspace \
deraining:latest \
python scripts/inference.py --weights untrusted.pthWhen processing user-uploaded images:
# Validate image before processing
def safe_load_image(path: str, max_size: int = 10 * 1024 * 1024):
"""Safely load and validate image.
Args:
path: Path to image file
max_size: Maximum file size in bytes (default: 10MB)
"""
# Check file size
if os.path.getsize(path) > max_size:
raise ValueError("Image too large")
# Use safe image loading
img = cv2.imread(path)
if img is None:
raise ValueError("Invalid image file")
# Validate dimensions
h, w = img.shape[:2]
if h > 4096 or w > 4096:
raise ValueError("Image dimensions too large")
return imgKeep dependencies updated:
# Check for known vulnerabilities
pip install safety
safety check
# Update packages
pip install --upgrade -r requirements.txt- Pickle Vulnerability: PyTorch model files (.pth) use pickle, which can execute arbitrary code
- Mitigation: Only load models from trusted sources, use
weights_only=Truein PyTorch 2.0+
- Large Images: Can cause memory exhaustion
- Mitigation: Validate image dimensions before processing
- Third-party libraries: May contain vulnerabilities
- Mitigation: Regular dependency updates, security scanning
- OOM Attacks: Maliciously large inputs can crash GPU
- Mitigation: Input size validation, memory monitoring
Security patches will be announced through:
- GitHub Security Advisories
- Release notes with
[SECURITY]tag - Updated CHANGELOG.md
Responsible disclosure researchers will be credited in:
- Security advisory
- Release notes
- CONTRIBUTORS.md (if desired)
For non-security questions about safety best practices:
- Open a GitHub Discussion
- Check existing security documentation
Thank you for helping keep this project secure! 🔒