|
| 1 | +# Security Policy |
| 2 | + |
| 3 | +## Supported Versions |
| 4 | + |
| 5 | +We actively support and provide security updates for the following versions: |
| 6 | + |
| 7 | +| Version | Supported | |
| 8 | +| ------- | ------------------ | |
| 9 | +| 1.x.x | :white_check_mark: | |
| 10 | +| < 1.0 | :x: | |
| 11 | + |
| 12 | +## Reporting a Vulnerability |
| 13 | + |
| 14 | +The Purl team takes security seriously. If you discover a security vulnerability, please follow these steps: |
| 15 | + |
| 16 | +### 1. Do NOT Create a Public Issue |
| 17 | + |
| 18 | +Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests. |
| 19 | + |
| 20 | +### 2. Report Privately |
| 21 | + |
| 22 | +Send a detailed report to **[email protected]** with: |
| 23 | + |
| 24 | +- **Subject**: `[SECURITY] Purl Ruby - [Brief Description]` |
| 25 | +- **Description** of the vulnerability |
| 26 | +- **Steps to reproduce** the issue |
| 27 | +- **Potential impact** assessment |
| 28 | +- **Suggested fix** (if you have one) |
| 29 | +- **Your contact information** for follow-up |
| 30 | + |
| 31 | +### 3. What to Include |
| 32 | + |
| 33 | +Please provide as much information as possible: |
| 34 | + |
| 35 | +``` |
| 36 | +- Affected versions |
| 37 | +- Attack vectors |
| 38 | +- Proof of concept (if safe to share) |
| 39 | +- Environmental details (Ruby version, OS, etc.) |
| 40 | +- Any relevant configuration details |
| 41 | +``` |
| 42 | + |
| 43 | +## Response Process |
| 44 | + |
| 45 | +### Initial Response |
| 46 | + |
| 47 | +- **24-48 hours**: We will acknowledge receipt of your report |
| 48 | +- **Initial assessment**: Within 1 week of acknowledgment |
| 49 | +- **Status updates**: Weekly until resolution |
| 50 | + |
| 51 | +### Investigation |
| 52 | + |
| 53 | +We will: |
| 54 | +1. **Confirm** the vulnerability exists |
| 55 | +2. **Assess** the severity and impact |
| 56 | +3. **Develop** a fix and mitigation strategy |
| 57 | +4. **Test** the fix thoroughly |
| 58 | +5. **Coordinate** disclosure timeline |
| 59 | + |
| 60 | +### Resolution |
| 61 | + |
| 62 | +- **High/Critical**: Immediate fix and release |
| 63 | +- **Medium**: Fix within 30 days |
| 64 | +- **Low**: Fix in next regular release cycle |
| 65 | + |
| 66 | +## Security Considerations |
| 67 | + |
| 68 | +### Input Validation |
| 69 | + |
| 70 | +The Purl library processes Package URL strings and performs: |
| 71 | + |
| 72 | +- **Scheme validation**: Ensures proper `pkg:` prefix |
| 73 | +- **Component parsing**: Validates type, namespace, name, version |
| 74 | +- **URI encoding**: Handles percent-encoded characters |
| 75 | +- **Qualifier parsing**: Processes key-value parameters |
| 76 | + |
| 77 | +### Potential Risk Areas |
| 78 | + |
| 79 | +Areas that warrant security attention: |
| 80 | + |
| 81 | +1. **URL Parsing**: Malformed URLs could cause parsing errors |
| 82 | +2. **Regular Expressions**: Complex patterns may be vulnerable to ReDoS |
| 83 | +3. **JSON Processing**: Configuration files require safe parsing |
| 84 | +4. **Network Requests**: Registry URL generation involves external URLs |
| 85 | + |
| 86 | +### Safe Usage Practices |
| 87 | + |
| 88 | +When using Purl in applications: |
| 89 | + |
| 90 | +- **Validate input**: Don't trust user-provided PURL strings |
| 91 | +- **Handle errors**: Properly catch and handle parsing exceptions |
| 92 | +- **Sanitize output**: Be careful when displaying parsed components |
| 93 | +- **Rate limiting**: If parsing many PURLs, implement appropriate limits |
| 94 | + |
| 95 | +## Disclosure Policy |
| 96 | + |
| 97 | +### Coordinated Disclosure |
| 98 | + |
| 99 | +We follow coordinated disclosure principles: |
| 100 | + |
| 101 | +1. **Private reporting** allows us to fix issues before public disclosure |
| 102 | +2. **Reasonable timeline** for fixes (typically 90 days maximum) |
| 103 | +3. **Credit and recognition** for responsible reporters |
| 104 | +4. **Public disclosure** after fixes are available |
| 105 | + |
| 106 | +### Public Disclosure |
| 107 | + |
| 108 | +After a fix is released: |
| 109 | + |
| 110 | +1. **Security advisory** published on GitHub |
| 111 | +2. **CVE requested** if applicable |
| 112 | +3. **Release notes** include security information |
| 113 | +4. **Community notification** through appropriate channels |
| 114 | + |
| 115 | +## Security Updates |
| 116 | + |
| 117 | +### Notification Channels |
| 118 | + |
| 119 | +Security updates are announced through: |
| 120 | + |
| 121 | +- **GitHub Security Advisories** |
| 122 | +- **RubyGems security alerts** |
| 123 | +- **Release notes and CHANGELOG** |
| 124 | +- **Project README updates** |
| 125 | + |
| 126 | +### Update Recommendations |
| 127 | + |
| 128 | +To stay secure: |
| 129 | + |
| 130 | +- **Monitor** our security advisories |
| 131 | +- **Update regularly** to the latest version |
| 132 | +- **Review** release notes for security fixes |
| 133 | +- **Subscribe** to GitHub notifications for this repository |
| 134 | + |
| 135 | +## Bug Bounty |
| 136 | + |
| 137 | +Currently, we do not offer a formal bug bounty program. However, we deeply appreciate security researchers who help improve the project's security posture. |
| 138 | + |
| 139 | +### Recognition |
| 140 | + |
| 141 | +Contributors who responsibly disclose security issues will be: |
| 142 | + |
| 143 | +- **Credited** in security advisories (with permission) |
| 144 | +- **Mentioned** in release notes |
| 145 | +- **Recognized** in project documentation |
| 146 | +- **Thanked** publicly (unless anonymity is requested) |
| 147 | + |
| 148 | +## Contact Information |
| 149 | + |
| 150 | +**Security Contact **: [email protected] |
| 151 | + |
| 152 | +**PGP Key**: Available upon request for encrypted communications |
| 153 | + |
| 154 | +**Response Time**: We aim to acknowledge security reports within 24-48 hours |
| 155 | + |
| 156 | +## Additional Resources |
| 157 | + |
| 158 | +- [PURL Specification Security Considerations](https://github.com/package-url/purl-spec) |
| 159 | +- [Ruby Security Best Practices](https://guides.rubyonrails.org/security.html) |
| 160 | +- [OWASP Secure Coding Practices](https://owasp.org/www-project-secure-coding-practices-quick-reference-guide/) |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +Thank you for helping keep Purl and its users safe! |
0 commit comments