Tzaruf takes security seriously. We are committed to providing a safe and secure document processing service for all users.
Please DO NOT report security vulnerabilities through public GitHub issues.
Instead, please report them via email to: security@tzaruf.dev
You should receive a response within 48 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
Please include as much information as possible:
- Type of vulnerability
- Step-by-step instructions to reproduce
- Proof-of-concept or exploit code (if available)
- Impact of the vulnerability
- Possible fix or mitigation (if you have suggestions)
- MIME Type Detection: We use magic bytes (libmagic) to validate file types, not just file extensions
- File Size Limits: Configurable maximum file sizes to prevent DoS
- Path Sanitization: All file paths are validated and sanitized
- Content Validation: Documents are validated before processing
- Isolated Processing: Document conversion runs in isolated processes
- Non-root Execution: Docker images run as non-root user
- Resource Limits: Configurable memory and CPU limits
- Regular Updates: Dependencies are regularly updated
- Security Scanning: Automated scanning with
banditandsafety - Dependabot: Automated PR creation for security updates
- Minimal Dependencies: We minimize dependencies to reduce attack surface
- Type Safety: Full type hints with mypy strict mode
- Linting: Ruff and other linters to catch potential issues
- Code Review: All changes require review
- Testing: Comprehensive test suite
- β No Telemetry: We don't collect any usage data
- β No Cloud: Processing is done locally, no cloud services
- β No Network: No outbound network requests (except for optional OCR models)
- β Temporary Files: Cleaned up after processing
- β Encrypted PDFs: Support for password-protected PDFs
- β Secure Defaults: Security-first default configurations
- β No Hardcoded Secrets: No credentials in code
-
Malicious PDFs: PDFs can contain JavaScript and other active content. We use PyMuPDF which handles this safely, but always be cautious with untrusted PDFs.
-
Encrypted PDFs: Password-protected PDFs require the password to process. We don't attempt to crack passwords.
-
Model Downloads: EasyOCR downloads models on first use. These are downloaded from official sources but require internet access.
-
GPU Access: If using GPU acceleration, the process needs GPU access which could be a privilege escalation vector in some environments.
-
Temporary Files: Temporary files are created during processing. Ensure your /tmp directory has appropriate permissions.
-
Disk Space: Large documents can consume significant disk space. Monitor available space.
When deploying Tzaruf in production:
- Run as non-root user
- Use Docker with appropriate resource limits
- Set restrictive file permissions
- Configure maximum file size limits
- Use firewall rules to restrict network access
- Regular updates of Tzaruf and dependencies
- Monitor logs for suspicious activity
- Use virus scanning on uploaded files
- Implement rate limiting for API endpoints
- Use HTTPS for API communications
- Validate all user inputs
- Regular security audits
from tzaruf import Forge, ForgeConfig
# Use secure defaults
config = ForgeConfig(
max_file_size_mb=50, # Limit file sizes
allow_encrypted_pdfs=False, # Disable if not needed
sanitize_filenames=True, # Always sanitize
)
forge = Forge(config=config)
# Validate inputs
if not input_path.exists():
raise ValueError("File not found")
if not input_path.is_file():
raise ValueError("Not a file")
# Process safely
try:
result = forge.convert(input_path, output_path)
except Exception as e:
# Handle errors appropriately
logger.error("Conversion failed", error=str(e))# Run with Docker for isolation
docker run --rm \
--cpus=2 \
--memory=4g \
--read-only \
--tmpfs /tmp \
-v /path/to/input:/data:ro \
-v /path/to/output:/output \
tzaruf:latest convert /data/input.docx /output/output.pdf
# Use AppArmor/SELinux for additional security
# Set up monitoring and alerting
# Regular backupsWe follow responsible disclosure:
- Day 0: Vulnerability reported to security@tzaruf.dev
- Day 1-2: Initial response and acknowledgment
- Day 3-14: Vulnerability assessment and fix development
- Day 15-30: Fix released and security advisory published
- Day 31+: Public disclosure after users have time to update
We appreciate security researchers who help make Tzaruf safer:
- (Your name could be here!)
- Security Issues: security@tzaruf.dev
- General Questions: GitHub Discussions
- Emergency: security@tzaruf.dev with [URGENT] prefix
Security updates will be:
- Published in CHANGELOG.md
- Announced in GitHub Security Advisories
- Tagged with appropriate CVE numbers if applicable
Last Updated: December 2024
Thank you for helping keep Tzaruf and its users safe! π