Skip to content

Commit 6c36d8f

Browse files
committed
fix(security): streamline vulnerability reporting and security measures
1 parent be70c75 commit 6c36d8f

File tree

1 file changed

+27
-93
lines changed

1 file changed

+27
-93
lines changed

SECURITY.md

Lines changed: 27 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2,122 +2,56 @@
22

33
## Supported Versions
44

5-
Currently, we support security updates for the following versions:
6-
7-
| Version | Supported |
8-
| ------- | ------------------ |
9-
| 0.1.x | :white_check_mark: |
10-
| < 0.1 | :x: |
5+
Security updates are provided for the latest released version only.
116

127
## Reporting a Vulnerability
138

14-
We take the security of @photostructure/sqlite seriously. If you believe you have found a security vulnerability, please report it to us as described below.
15-
16-
### How to Report
17-
18-
**Please do not report security vulnerabilities through public GitHub issues.**
19-
20-
Instead, please report them via one of the following methods:
21-
22-
1. Email us at [email protected]
23-
2. Use GitHub's private vulnerability reporting feature (if available)
24-
25-
### What to Include
9+
**Do not report security vulnerabilities through public GitHub issues.**
2610

27-
Please include the following information in your report:
11+
Report via:
12+
13+
- GitHub's private vulnerability reporting
2814

29-
- Type of issue (e.g., buffer overflow, SQL injection, cross-site scripting, etc.)
30-
- Full paths of source file(s) related to the manifestation of the issue
31-
- The location of the affected source code (tag/branch/commit or direct URL)
32-
- Any special configuration required to reproduce the issue
33-
- Step-by-step instructions to reproduce the issue
34-
- Proof-of-concept or exploit code (if possible)
35-
- Impact of the issue, including how an attacker might exploit it
15+
Include: issue type, affected source files, reproduction steps, and potential impact.
3616

37-
### Response Timeline
38-
39-
- We will acknowledge receipt of your vulnerability report within 48 hours
40-
- We will provide a more detailed response within 7 days
41-
- We will work on fixes and coordinate disclosure timeline with you
17+
We acknowledge reports within 48 hours and provide detailed response within 7 days.
4218

4319
## Security Measures
4420

45-
### Automated Security Scanning
46-
47-
This project employs multiple layers of automated security scanning:
48-
49-
1. **npm audit** - Scans for known vulnerabilities in dependencies
50-
2. **OSV Scanner** - Google's Open Source Vulnerabilities scanner
51-
3. **CodeQL** - GitHub's semantic code analysis for both JavaScript/TypeScript and C++
52-
4. **TruffleHog** - Secrets detection in code
53-
5. **ESLint Security Plugin** - Static analysis for JavaScript/TypeScript security patterns
54-
55-
### CodeQL Configuration
56-
57-
Our CodeQL setup is configured to focus on security issues in our own code:
21+
### Automated Scanning
5822

59-
- **JavaScript/TypeScript**: Uses `paths-ignore` to exclude upstream and vendor directories
60-
- **C++**: Uses SARIF filtering to exclude upstream SQLite code after scanning
23+
- **npm audit** and **OSV Scanner** for dependency vulnerabilities
24+
- **CodeQL** for JS/TS and C++ semantic analysis
25+
- **TruffleHog** for secrets detection
26+
- **ESLint Security Plugin** for static analysis
6127

62-
This ensures we identify security issues in our code while filtering out alerts from upstream dependencies that we cannot directly control.
63-
64-
These scans run automatically on:
65-
66-
- Every push to the main branch
67-
- Every pull request
68-
- Weekly scheduled scans
69-
- Manual workflow dispatch
70-
71-
### Development Practices
72-
73-
- All dependencies are regularly updated via Dependabot
74-
- Security patches are prioritized and released quickly
75-
- Native C++ code is analyzed with clang-tidy and ASAN
76-
- Memory safety is validated through comprehensive testing
28+
Scans run on every push, PR, and weekly.
7729

7830
### Native Code Security
7931

80-
Since this package includes native C++ bindings to SQLite:
81-
82-
- We use the official SQLite amalgamation source
83-
- SQLite is compiled with recommended security flags
84-
- Buffer overflows are prevented through careful memory management
85-
- All user inputs are properly validated before passing to SQLite
32+
- Uses official SQLite amalgamation source with recommended security flags
33+
- C++ code analyzed with clang-tidy and ASAN
34+
- Memory safety validated through comprehensive testing
8635

8736
## Security Configuration
8837

89-
### SQLite Security Features
90-
91-
The following SQLite security features are available:
92-
9338
```javascript
94-
// Restrict file access to read-only
95-
const db = new DatabaseSync("database.db", {
96-
readonly: true,
97-
});
98-
99-
// Disable extension loading by default
100-
// Extensions must be explicitly enabled
101-
db.allowExtension(); // Required first
102-
db.enableLoadExtension(true); // Then enable
39+
// Read-only mode
40+
const db = new DatabaseSync("database.db", { readonly: true });
41+
42+
// Extension loading (disabled by default)
43+
db.allowExtension();
44+
db.enableLoadExtension(true);
10345
db.loadExtension("path/to/extension");
10446
```
10547

10648
### Best Practices
10749

108-
1. **Always validate and sanitize user input** before using in SQL queries
109-
2. **Use parameterized queries** to prevent SQL injection
110-
3. **Run with minimal permissions** when possible
111-
4. **Keep dependencies updated** regularly
112-
5. **Monitor security advisories** for SQLite and Node.js
50+
1. Use parameterized queries to prevent SQL injection
51+
2. Validate user input before use in queries
52+
3. Run with minimal permissions
53+
4. Keep dependencies updated
11354

11455
## Disclosure Policy
11556

116-
When we receive a security report, we will:
117-
118-
1. Confirm the problem and determine affected versions
119-
2. Audit code to find similar problems
120-
3. Prepare fixes for all supported versions
121-
4. Coordinate disclosure with the reporter
122-
123-
We aim to disclose vulnerabilities responsibly, balancing the need for users to be informed with giving them time to update.
57+
Upon receiving a report, we confirm the issue, audit for similar problems, prepare fixes, and coordinate disclosure with the reporter.

0 commit comments

Comments
 (0)