1. Insecure Dependency Usage: The repository uses outdated libraries that have known vulnerabilities.
2. Improper Input Validation: User inputs are not adequately validated, potentially leading to injection attacks.
3. Hardcoded Secrets: Sensitive information like API keys or passwords are hardcoded, exposing them to misuse.
1. Insecure Dependency Usage:
- Affected Code Sections: package.json (lines 12-15)
- Details: Outdated libraries (express 4.17.1, lodash 4.17.21) have known vulnerabilities (CVE-2022-11534, CVE-2021-23337).
- Code Snippet:
```
"dependencies": {
"express": "^4.17.1",
"lodash": "^4.17.21"
}
2. Improper Input Validation:
- Affected Code Sections: src/controllers/userController.js (lines 23-25)
- Details: Unsantized user input in database queries vulnerable to SQL injection.
- Code Snippet:
```
const username = req.body.username;
const password = req.body.password;
const query = `SELECT * FROM users WHERE username = '${username}' AND password = '${password}'`;
3. Hardcoded Secrets:
- Affected Code Sections: src/config/config.js (lines 10-12)
- Details: API keys exposed in version control history.
- Code Snippet:
```
const apiKeys = {
secretKey: 'YOUR_SECRET_KEY_HERE',
apiKey: 'YOUR_API_KEY_HERE'
};
```
1. Insecure Dependency Usage: Remote code execution or denial of service.
2. Improper Input Validation: Data breaches or unauthorized access.
3. Hardcoded Secrets: Unauthorized access to third-party services and data leaks.
1. Snyk (dependency vulnerability scanning)
2. ESLint (code quality and security checks)
3. GitSecrets (hardcoded secret detection)
1. Insecure Dependency Usage:
- Update dependencies to latest stable versions.
- Regularly monitor updates using Snyk.
2. Improper Input Validation:
- Implement input validation/sanitization (express-validator).
3. Hardcoded Secrets:
- Remove hardcoded secrets; use environment variables or secret management tools (dotenv, AWS Secrets Manager).
- Use .gitignore and Git hooks to prevent sensitive info commits.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.