-
Notifications
You must be signed in to change notification settings - Fork 15
security: [HIGH] Missing input validation on Reddit credentials #3198
Copy link
Copy link
Open
Labels
needs-human-reviewIssue needs human review before automated processingIssue needs human review before automated processingsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns
Description
Summary
Reddit OAuth credentials from environment variables are used directly in HTTP Basic auth without validation, which could lead to authentication bypass if credentials contain special characters.
Location
.claude/skills/setup-agent-team/reddit-fetch.ts:82-90 — getToken()
Vulnerability
The code constructs HTTP Basic auth by concatenating CLIENT_ID and CLIENT_SECRET with a colon:
const auth = Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString("base64");If either credential contains a colon character, the Basic auth encoding is broken (the server will parse the wrong username/password). Additionally, if credentials contain newlines, they could inject headers.
Risk
- Severity: HIGH
- Impact: Authentication bypass or header injection
- Probability: Low (requires malicious env vars)
- Defense-in-depth: Validates the integrity of credential formatting
Recommendation
Add input validation before constructing the auth header:
if (CLIENT_ID.includes(':') || CLIENT_ID.includes('\n') ||
CLIENT_SECRET.includes(':') || CLIENT_SECRET.includes('\n')) {
console.error('Invalid Reddit credentials format');
process.exit(1);
}Context
Filed by automated security scan (2026-04-06)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-human-reviewIssue needs human review before automated processingIssue needs human review before automated processingsafe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processingsecuritySecurity vulnerabilities and concernsSecurity vulnerabilities and concerns