swapniltamse/claude-security-engineer

injection-check

Scans all code that constructs queries, commands, or markup from user input, blocking SQL injection, command injection, LDAP injection, and XSS before the code ships.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/swapniltamse/claude-security-engineer --skill injection-check

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Injection Check Skill

Injection is the class of vulnerability where user-supplied input is interpreted as part of a command or query rather than as data. An agent generating database or shell code will often use string formatting because it is simpler. Simpler is what gets exploited.

What to Check Before Writing Input-Handling Code

SQL Injection Scan for string concatenation or f-string/format-string construction of SQL queries. Every parameterized query is safe. Every concatenated query is a vulnerability.

Patterns to flag:

  • "SELECT * FROM users WHERE id = " + user_id
  • f"SELECT * FROM users WHERE name = '{name}'"
  • cursor.execute("DELETE FROM orders WHERE id = %s" % order_id) (note: %s with % substitution, not parameterized)
  • Raw query builders that accept unsanitized field names for ORDER BY or column selection

Command Injection Any code that passes user input to os.system, subprocess, exec, eval, shell=True, or equivalent in any language is a block condition unless the input is fully validated against a whitelist.

Patterns to flag:

  • os.system(f"convert {filename} output.pdf")
  • subprocess.run(user_command, shell=True)
  • eval(user_expression)

XSS (Cross-Site Scripting) HTML rendered to a browser that includes unsanitized user input is an XSS vulnerability. Flag any template or string that places user-supplied values directly into HTML without escaping. Server-side rendering frameworks that auto-escape are acceptable only if auto-escape is confirmed to be on.

LDAP Injection LDAP queries constructed from user input without escaping are injectable. Flag any LDAP filter construction that uses string concatenation with user input.

Output Format

## Injection Check

**Input sources identified:** [list of places user input enters the code]
**Query/command types constructed:** [SQL / shell / HTML / LDAP / XML / other]

### Findings
[For each finding: pattern detected, file and line, severity]

### Verdict
[CLEAR / BLOCKED — list each injection risk found]

Hard Stops

Block before writing code if:

  • A SQL query is constructed via string concatenation or formatting with user input
  • User input is passed to a shell command without whitelist validation
  • HTML output includes user input without confirmed escaping
  • eval() or exec() is called with any user-influenced value
  • shell=True is used with subprocess and the command includes user input

What Good Looks Like

python
# Good: parameterized SQL
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))

# Good: subprocess without shell, arguments as list
result = subprocess.run(["convert", filename, "output.pdf"], capture_output=True)

# Good: ORM with parameterization built in
user = User.objects.filter(id=user_id).first()
python
# Bad: SQL concatenation
cursor.execute("SELECT * FROM users WHERE id = " + user_id)

# Bad: shell command with user input
os.system(f"convert {request.args['file']} output.pdf")

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills