Skip to content
Back to skills

Common Security Standards

ASecurity

The code is vulnerable to SQL injection because untrusted `userName` is concatenated into a raw SQL string. It also omits quotes around the value. Use a parameterized query or ORM instead: ```js const result = await db.query( 'SELECT * FROM users WHERE name = $1', [userName] ); ``` For drivers using `?` placeholders: ```js const result = await db.query( 'SELECT * FROM users WHERE name = ?', [userName] ); ``` Also: - Treat `userName` as untrusted at the API/UI boundary; validate expected type,...

  • 584 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentrustgosqlapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill common-security-standards --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Common Security Standards?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Common Security Standards
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-common-security-standards-5fc7f533/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-common-security-standards-5fc7f533)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
The code is vulnerable to SQL injection because untrusted `userName` is concatenated into a raw SQL string. It also omits quotes around the value.

Use a parameterized query or ORM instead:

```js
const result = await db.query(
  'SELECT * FROM users WHERE name = $1',
  [userName]
);
```

For drivers using `?` placeholders:

```js
const result = await db.query(
  'SELECT * FROM users WHERE name = ?',
  [userName]
);
```

Also:

- Treat `userName` as untrusted at the API/UI boundary; validate expected type, length, and format.
- Use least-privilege database credentials.
- Avoid logging the user’s name or other PII.
- Add SQL-injection tests and run SAST/DAST scanners in CI.
- If authentication is involved, store passwords with Argon2id; unrelated session protections should use HttpOnly Secure cookies and rate limiting where appropriate.

Files in this skill

  • eval-1.baseline.md1.6 KB
  • eval-1.with-skill.md3.4 KB
  • eval-2.baseline.md854 B
  • eval-2.with-skill.md1.9 KB
  • eval-3.baseline.md477 B
  • eval-3.with-skill.md850 B
  • trigger-1.md127 B
  • trigger-2.md204 B
  • trigger-3.md104 B
  • trigger-4.md188 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.