Security Vulnerability Report
Severity: High
Vulnerability Type: Sensitive Data Exposure
Affected Files and Lines
.gitignore - Missing entries
src/services/x-auth.ts - Line 34, 189-203
Code Snippet
// src/services/x-auth.ts:189-203
private saveTokens(tokens: XTokens): void {
let store: XTokensStore = {};
if (existsSync(this.tokensPath)) {
try {
const data = readFileSync(this.tokensPath, 'utf-8');
store = JSON.parse(data);
} catch (error) {
// Ignore parse errors, will overwrite
}
}
store.x = tokens;
// Write with restrictive permissions (owner read/write only) to protect OAuth tokens
writeFileSync(this.tokensPath, JSON.stringify(store, null, 2), { mode: 0o600 });
}
Description
The .gitignore file is missing entries for several sensitive files:
.shippost-tokens.json (OAuth tokens for X/Twitter API)
.shippost-impressions-cache.json (contains cached API data)
.shippost-stats-cache.json (contains cached statistics)
.shippost-skipped-tweets.json (contains tweet IDs and timestamps)
.ship-blog-state.json (contains processed tweet state)
While the code attempts to protect tokens with file permissions (0o600), if a user accidentally runs git add . or has git configuration that commits hidden files, OAuth tokens could be exposed in git history permanently.
Impact
- OAuth tokens could be exposed in git history
- Tokens cannot be removed from git history without force-pushing
- Compromised tokens could allow attackers to post on behalf of users
Recommended Fix
Add the following entries to .gitignore:
# OAuth tokens (sensitive)
.shippost-tokens.json
# API caches (may contain sensitive data)
.shippost-impressions-cache.json
.shippost-stats-cache.json
.shippost-skipped-tweets.json
.ship-blog-state.json
References
Security Vulnerability Report
Severity: High
Vulnerability Type: Sensitive Data Exposure
Affected Files and Lines
.gitignore- Missing entriessrc/services/x-auth.ts- Line 34, 189-203Code Snippet
Description
The
.gitignorefile is missing entries for several sensitive files:.shippost-tokens.json(OAuth tokens for X/Twitter API).shippost-impressions-cache.json(contains cached API data).shippost-stats-cache.json(contains cached statistics).shippost-skipped-tweets.json(contains tweet IDs and timestamps).ship-blog-state.json(contains processed tweet state)While the code attempts to protect tokens with file permissions (0o600), if a user accidentally runs
git add .or has git configuration that commits hidden files, OAuth tokens could be exposed in git history permanently.Impact
Recommended Fix
Add the following entries to
.gitignore:References