Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: high
Invalid

1. Insecure Dependency Usage 2. Improper Input Validation 3. Hardcoded Secrets

Summary

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.

Vulnerability Details

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'

};

```

Impact

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.

Tools Used

1. Snyk (dependency vulnerability scanning)

2. ESLint (code quality and security checks)

3. GitSecrets (hardcoded secret detection)

Recommendations

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.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Out of scope

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.