Skip to content

About

PHP 8+ / Gnuboard5 security review skill for OpenCode and Claude Code - code, version, and dependency checks

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

php-security-review

PHP 8+ / ๊ทธ๋ˆ„๋ณด๋“œ5 ๋ณด์•ˆ ๊ฒ€์ˆ˜ ์Šคํ‚ฌ โ€” ์ฝ”๋“œยท๋ฒ„์ „ยท์˜์กด์„ฑ 3์ถ• ๊ฒ€์ˆ˜ Security review skill for PHP 8+ and Gnuboard5 โ€” code, version, and dependency checks

ํ•œ๊ตญ์–ด ยท English


ํ•œ๊ตญ์–ด

ํ•œ ์ค„ ์†Œ๊ฐœ

AI ์ฝ”๋”ฉ ์—์ด์ „ํŠธ(OpenCode ยท Claude Code)์— ์„ค์น˜ํ•˜๋Š” PHP ๋ณด์•ˆ ๊ฒ€์ˆ˜ ์›Œํฌํ”Œ๋กœ์ž…๋‹ˆ๋‹ค. ์ •์  ์Šค์บ๋„ˆ๋กœ ํ›„๋ณด๋ฅผ ๋ฝ‘๊ณ , source โ†’ sink ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์‹ค์ œ ์ฝ”๋“œ๋กœ ์ถ”์ ํ•ด ํŒ์ •ํ•˜๋ฉฐ, PHP/๊ทธ๋ˆ„๋ณด๋“œ ๋ฒ„์ „๊ณผ ์•Œ๋ ค์ง„ CVE๋ฅผ ๋Œ€์กฐํ•ด "์ง€๊ธˆ ๋‹น์žฅ ํŒจ์น˜ํ•ด์•ผ ํ•  ๊ฒƒ"์„ ๋งจ ์•ž์— ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

๋‹จ์ˆœ grep์ด ์•„๋‹™๋‹ˆ๋‹ค. ํ›„๋ณด๋ฅผ ์ฆ๊ฑฐ ๊ธฐ๋ฐ˜์œผ๋กœ ํ™•์ •/๊ธฐ๊ฐํ•˜๊ณ , ๋ฐฉ์–ด ์ฝ”๋“œ๊ฐ€ ์‹ฑํฌ ์ง์ „์— ์žˆ๋Š”์ง€๊นŒ์ง€ ๋ด…๋‹ˆ๋‹ค.

๋ฌด์—‡์„ ์žก๋Š”๊ฐ€

์ถ• ๋‚ด์šฉ
์ฝ”๋“œ SQLi, XSS, LFI/RFI, ํŒŒ์ผ ์—…๋กœ๋“œ, ์—ญ์ง๋ ฌํ™”, ์ปค๋งจ๋“œ ์ธ์ ์…˜, SSRF, XXE, CSRF, ์„ธ์…˜/์ธ์ฆ ๊ฒฐํ•จ, ์˜คํ”ˆ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ, ์‹œํฌ๋ฆฟ ํ•˜๋“œ์ฝ”๋”ฉ, ์•ฝํ•œ ํ•ด์‹œ/๋‚œ์ˆ˜
๋ฒ„์ „ PHP ์ฝ”์–ด CVE(์˜ˆ: PHP2Shell), ๊ทธ๋ˆ„๋ณด๋“œ/์˜์นดํŠธ ๋ณด์•ˆํŒจ์น˜ ๋ˆ„๋ฝ, install/ยทdata/ ๋…ธ์ถœ
์˜์กด์„ฑ composer audit ์—ฐ๋™ (ํ•ด๋‹น ์‹œ)

์ผ๋ฐ˜ ์Šค์บ๋„ˆ์™€ ๋‹ค๋ฅธ ์ 

  1. ๋ฐ์ดํ„ฐ ํ๋ฆ„ ํŒ์ • โ€” $_GET์—์„œ ์‹œ์ž‘ํ•ด ์‹ฑํฌ๊นŒ์ง€ ์ถ”์ ํ•˜๊ณ , ์ค‘๊ฐ„ ๊ฒ€์ฆ์ด ์‹ค์ œ๋กœ ํ๋ฆ„์„ ์ฐจ๋‹จํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ๊ฒ€์ฆ ๊ฒฐ๊ณผ๋ฅผ ๋ฒ„๋ฆฌ๊ณ  ์›๋ณธ์„ ์“ฐ๋Š” ์ฝ”๋“œ๋ฅผ ์žก์Šต๋‹ˆ๋‹ค.
  2. ์‹ฑํฌ๋ณ„ ๋ฐฉ์–ด ์ ํ•ฉ์„ฑ โ€” intval()์„ HTML ์ถœ๋ ฅ์— ์“ด ์ฝ”๋“œ, htmlspecialchars()๋ฅผ SQL์— ์“ด ์ฝ”๋“œ๋ฅผ "์•ˆ์ „"์œผ๋กœ ์˜คํŒํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  3. ๋ฒ„์ „ ์ถ• โ€” ์ฝ”๋“œ๊ฐ€ ์•„๋ฌด๋ฆฌ ๊นจ๋—ํ•ด๋„ PHP ์ฝ”์–ด๊ฐ€ ํŒจ์น˜๋˜์ง€ ์•Š์•˜์œผ๋ฉด ๋šซ๋ฆฝ๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์„ ๋ณ„๋„ ๋‹จ๊ณ„(Step 0.5)๋กœ ๊ฐ•์ œํ•ฉ๋‹ˆ๋‹ค.
  4. ๊ทธ๋ˆ„๋ณด๋“œ ํ”„๋กœํ•„ โ€” ์ฝ”์–ด์™€ ์ปค์Šคํ…€์„ ๋ถ„๋ฆฌํ•˜๊ณ , ์ฝ”์–ด ์ง์ ‘ ์ˆ˜์ • ๋Œ€์‹  ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋ฅผ ๊ถŒ๊ณ ํ•ฉ๋‹ˆ๋‹ค. addslashes ๊ด€ํ–‰ ๊ฐ™์€ ์ฝ”์–ด ํŠน์œ ์˜ ์˜คํƒ์„ ์ค„์ž…๋‹ˆ๋‹ค.
  5. ์˜คํƒ ์–ต์ œ โ€” ๊ทธ๋ˆ„๋ณด๋“œ 1,600ํŒŒ์ผ ์ „์ฒด ์Šค์บ” ์‹œ 5,000๊ฑด๋Œ€ ํ›„๋ณด๊ฐ€ ๋‚˜์˜ค๋Š” ๊ฒƒ์„ ์ปค์Šคํ…€ ์˜์—ญ + -MinSeverity ํ•„ํ„ฐ๋กœ ์‹ค๋ฌด ์ˆ˜์ค€๊นŒ์ง€ ์ขํž™๋‹ˆ๋‹ค.

์ €์žฅ์†Œ ๊ตฌ์กฐ

php-security-review/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE                      # MIT
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ AGENTS.md                    # ๋ฒ”์šฉ ์—์ด์ „ํŠธ ์ง„์ž…์  (Codex/Cursor/Copilot/Antigravity)
โ”œโ”€โ”€ skills/
โ”‚   โ””โ”€โ”€ php-security-review/     # โ† ์Šคํ‚ฌ ๋ณธ์ฒด (๋””๋ ‰ํ„ฐ๋ฆฌ๋ช… = ์Šคํ‚ฌ ID)
โ”‚       โ”œโ”€โ”€ SKILL.md             # ์›Œํฌํ”Œ๋กœ Step 0 ~ 6 + Step 0.5
โ”‚       โ”œโ”€โ”€ agents/
โ”‚       โ”‚   โ””โ”€โ”€ openai.yaml          # ChatGPT/Codex ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ (์ž๋™ ํ˜ธ์ถœ off)
โ”‚       โ”œโ”€โ”€ references/
โ”‚       โ”‚   โ”œโ”€โ”€ checklist.md         # CWE ๋งคํ•‘ ์ทจ์•ฝ์  ์นดํƒˆ๋กœ๊ทธ
โ”‚       โ”‚   โ”œโ”€โ”€ php8-hardening.md    # PDO/์„ธ์…˜/์—…๋กœ๋“œ/CSRF/SSRF/ํ—ค๋” ํ•˜๋“œ๋‹ ์ฝ”๋“œ
โ”‚       โ”‚   โ”œโ”€โ”€ gnuboard.md          # ๊ทธ๋ˆ„๋ณด๋“œ5 ํ”„๋กœํ•„ (์ฝ”์–ด vs ์ปค์Šคํ…€)
โ”‚       โ”‚   โ””โ”€โ”€ advisories.md        # CVE ์Šค๋ƒ…์ƒท (PHP2Shell, ๊ทธ๋ˆ„๋ณด๋“œ KVE)
โ”‚       โ””โ”€โ”€ scripts/
โ”‚           โ”œโ”€โ”€ scan.ps1             # ํœด๋ฆฌ์Šคํ‹ฑ ์Šค์บ๋„ˆ (37๊ฐœ ๊ทœ์น™)
โ”‚           โ””โ”€โ”€ version-check.ps1    # ๋ฒ„์ „ยทCVE ๋Œ€์กฐ
โ”œโ”€โ”€ commands/
โ”‚   โ””โ”€โ”€ phpsec.md                # /phpsec ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ install.ps1              # ์—์ด์ „ํŠธ๋ณ„ ์ž๋™ ์„ค์น˜ (Windows)
โ”‚   โ””โ”€โ”€ install.sh               # ์—์ด์ „ํŠธ๋ณ„ ์ž๋™ ์„ค์น˜ (macOS/Linux)
โ”œโ”€โ”€ .cursor/rules/               # Cursor ๊ทœ์น™
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ copilot-instructions.md  # Copilot ์ €์žฅ์†Œ ์ง€์นจ
โ”œโ”€โ”€ portable/
โ”‚   โ”œโ”€โ”€ chatgpt-instructions.md  # ChatGPT Custom GPT / Project ์ง€์นจ
โ”‚   โ””โ”€โ”€ chat-prompt.md           # ๋ฒ”์šฉ ์ฑ„ํŒ… ๋ถ™์—ฌ๋„ฃ๊ธฐ ํ”„๋กฌํ”„ํŠธ
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ install.md               # ์„ค์น˜ ์ƒ์„ธ
โ”‚   โ”œโ”€โ”€ usage.md                 # ์‚ฌ์šฉ๋ฒ• ์ƒ์„ธ (์‹œ๋‚˜๋ฆฌ์˜ค๋ณ„)
โ”‚   โ””โ”€โ”€ portable.md              # ๋‹ค๋ฅธ AI ์—์ด์ „ํŠธ์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ
โ””โ”€โ”€ examples/
    โ””โ”€โ”€ report-sample.md         # ๋ณด๊ณ ์„œ ์ถœ๋ ฅ ์˜ˆ์‹œ

์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๊ฐ ์—์ด์ „ํŠธ์˜ ์Šคํ‚ฌ ๊ฒฝ๋กœ๋กœ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๊ฒฝ๋กœ ํ‘œ๋Š” docs/portable.md ์ฐธ๊ณ .

์š”๊ตฌ์‚ฌํ•ญ

ํ•ญ๋ชฉ ํ•„์ˆ˜ ๋น„๊ณ 
Windows PowerShell 5.1+ โœ… Windows 10/11 ๊ธฐ๋ณธ ํƒ‘์žฌ. PowerShell 7(pwsh)๋„ ๊ฐ€๋Šฅ
OpenCode ๋˜๋Š” Claude Code โœ… Agent Skills ์ง€์› ์—์ด์ „ํŠธ. ์Šคํฌ๋ฆฝํŠธ๋งŒ ๋‹จ๋… ์‚ฌ์šฉ๋„ ๊ฐ€๋Šฅ
PHP CLI โฌœ php -l ๋ฌธ๋ฒ• ๊ฒ€์‚ฌ์šฉ. ์—†์–ด๋„ ๊ฒ€์ˆ˜ ๊ฐ€๋Šฅ
Git โฌœ ์ €์žฅ์†Œ ์„ค์น˜ ์‹œ
์„ ํ–‰ ์Šคํ‚ฌ โŒ ์—†์Œ. ๋…๋ฆฝ ์‹คํ–‰ํ˜•์ž…๋‹ˆ๋‹ค (์•„๋ž˜ ์ฐธ๊ณ )

ํ•„์ˆ˜ ์„ ํ–‰ ์Šคํ‚ฌ์€ ์—†์Šต๋‹ˆ๋‹ค

์ด ์Šคํ‚ฌ์€ ๋‹ค๋ฅธ ์Šคํ‚ฌ์— ์˜์กดํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฒดํฌ๋ฆฌ์ŠคํŠธยทํ•˜๋“œ๋‹ ์ฝ”๋“œยท์Šค์บ๋„ˆยทCVE ์Šค๋ƒ…์ƒท์ด ๋ชจ๋‘ ์ €์žฅ์†Œ ์•ˆ์— ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

ํ˜น์‹œ ํ•จ๊ป˜ ์„ค์น˜๋œ frontend-design, taste-skill ๊ฐ™์€ ์Šคํ‚ฌ์ด ๋ณด์—ฌ๋„ ๋ฌด๊ด€ํ•ฉ๋‹ˆ๋‹ค(UI/๋””์ž์ธ์šฉ). ์ด ์Šคํ‚ฌ์€ ๊ทธ๊ฒƒ๋“ค์„ ์ฝ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

ํ•„์š”ํ•œ ๊ฒƒ์€ "์Šคํ‚ฌ"์ด ์•„๋‹ˆ๋ผ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค:

# ํ™•์ธ
powershell -Command "$PSVersionTable.PSVersion"   # 5.1 ์ด์ƒ
php -v                                            # ์„ ํƒ
git --version                                     # ์„ ํƒ

์ง€์› ํ™˜๊ฒฝ

SKILL.md ์˜คํ”ˆ ํ‘œ์ค€์„ ๋”ฐ๋ฅด๋ฏ€๋กœ ํ•˜๋‚˜์˜ ํด๋”๋ฅผ ์—ฌ๋Ÿฌ ์—์ด์ „ํŠธ์—์„œ ๊ทธ๋Œ€๋กœ ์”๋‹ˆ๋‹ค.

์—์ด์ „ํŠธ ์ง€์› ์„ค์น˜ ๊ฒฝ๋กœ (์ „์—ญ / ํ”„๋กœ์ ํŠธ)
OpenCode โœ… ~/.config/opencode/skills/ / .opencode/skills/
Claude Code โœ… ~/.claude/skills/ / .claude/skills/
Codex CLI ยท ChatGPT ๋ฐ์Šคํฌํ†ฑ โœ… ~/.agents/skills/ / .agents/skills/
Google Antigravity โœ… ~/.gemini/config/skills/ / .agents/skills/
Cursor โœ… ~/.cursor/skills/ / .cursor/skills/, .agents/skills/
GitHub Copilot โœ… ~/.copilot/skills/ / .github/skills/, .agents/skills/
Gemini CLI (๋ ˆ๊ฑฐ์‹œ) โœ… ~/.gemini/skills/ / .gemini/skills/
ChatGPT ์›น โ–ณ Custom GPT / Project์— ์ง€์นจ + ์ง€์‹ ํŒŒ์ผ
Claude ์›น ยท Gemini ์›น โ–ณ ํ”„๋กฌํ”„ํŠธ์— ์š”์•ฝ ๋ถ™์—ฌ๋„ฃ๊ธฐ

.agents/skills/ ๋Š” Codex ยท Cursor ยท Copilot ยท Antigravity๊ฐ€ ๊ณตํ†ต์œผ๋กœ ์ฝ์Šต๋‹ˆ๋‹ค. ํ•œ ๋ฒˆ ๋ณต์‚ฌ๋กœ ์—ฌ๋Ÿฌ ์—์ด์ „ํŠธ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—์ด์ „ํŠธ๋ณ„ ์ƒ์„ธ ์ ˆ์ฐจ์™€ ์ œ์•ฝ: docs/portable.md

์„ค์น˜

๋ฐฉ๋ฒ• 0 โ€” ์ž๋™ ์„ค์น˜ (๊ถŒ์žฅ)

git clone https://github.com/1clickmake/php-security-review.git "$env:TEMP\psr"
cd "$env:TEMP\psr"

# ์ „์ฒด ์—์ด์ „ํŠธ์— ์ „์—ญ ์„ค์น˜
.\scripts\install.ps1 -Target all -Scope global

# ํŠน์ • ์—์ด์ „ํŠธ + /phpsec ์ปค๋งจ๋“œ
.\scripts\install.ps1 -Target opencode,claude -Scope global -WithCommand

# ํŠน์ • ํ”„๋กœ์ ํŠธ์— ์„ค์น˜
.\scripts\install.ps1 -Target cursor -Scope project -ProjectPath C:\work\my-site

macOS/Linux:

./scripts/install.sh --target all --scope global

๋ฐฉ๋ฒ• 1 โ€” OpenCode ์ „์—ญ ์„ค์น˜

# 1) ์ €์žฅ์†Œ ๋ฐ›๊ธฐ
git clone https://github.com/1clickmake/php-security-review.git "$env:TEMP\php-security-review"

# 2) ์Šคํ‚ฌ ๋ณต์‚ฌ (์ „์—ญ)
New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode\skills" | Out-Null
Copy-Item "$env:TEMP\php-security-review\skills\php-security-review" `
          "$env:USERPROFILE\.config\opencode\skills\" -Recurse -Force

# 3) ์Šฌ๋ž˜์‹œ ์ปค๋งจ๋“œ ๋ณต์‚ฌ
New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode\commands" | Out-Null
Copy-Item "$env:TEMP\php-security-review\commands\phpsec.md" `
          "$env:USERPROFILE\.config\opencode\commands\" -Force

# 4) ์ •๋ฆฌ
Remove-Item "$env:TEMP\php-security-review" -Recurse -Force

์„ค์น˜ ๊ฒฐ๊ณผ:

%USERPROFILE%\.config\opencode\
โ”œโ”€โ”€ skills\php-security-review\
โ”‚   โ”œโ”€โ”€ SKILL.md
โ”‚   โ”œโ”€โ”€ references\...
โ”‚   โ””โ”€โ”€ scripts\...
โ””โ”€โ”€ commands\phpsec.md

์ค‘์š”: ์Šคํ‚ฌ ID๋Š” frontmatter์˜ name์ด ์•„๋‹ˆ๋ผ ๋””๋ ‰ํ„ฐ๋ฆฌ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ๋ฐ˜๋“œ์‹œ php-security-review ํด๋”๋ช…์„ ์œ ์ง€ํ•˜์„ธ์š”.

๋ฐฉ๋ฒ• 2 โ€” ํ”„๋กœ์ ํŠธ๋ณ„ ์„ค์น˜

ํ•ด๋‹น ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ์—์„œ:

New-Item -ItemType Directory -Force ".opencode\skills" | Out-Null
Copy-Item "C:\path\to\php-security-review\skills\php-security-review" ".opencode\skills\" -Recurse -Force
New-Item -ItemType Directory -Force ".opencode\commands" | Out-Null
Copy-Item "C:\path\to\php-security-review\commands\phpsec.md" ".opencode\commands\" -Force

ํ”„๋กœ์ ํŠธ๋ณ„ ์„ค์น˜๊ฐ€ ์ „์—ญ ์„ค์น˜๋ณด๋‹ค ์šฐ์„ ํ•ฉ๋‹ˆ๋‹ค.

๋ฐฉ๋ฒ• 3 โ€” Claude Code

New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\skills" | Out-Null
Copy-Item "C:\path\to\php-security-review\skills\php-security-review" `
          "$env:USERPROFILE\.claude\skills\" -Recurse -Force

New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude\commands" | Out-Null
Copy-Item "C:\path\to\php-security-review\commands\phpsec.md" `
          "$env:USERPROFILE\.claude\commands\" -Force

๋ฐฉ๋ฒ• 4 โ€” ์Šคํ‚ฌ ์—†์ด ์Šคํฌ๋ฆฝํŠธ๋งŒ

์—์ด์ „ํŠธ ์—†์ด ์Šค์บ๋„ˆ๋งŒ ์“ฐ๋ ค๋ฉด ์ €์žฅ์†Œ๋ฅผ ์•„๋ฌด ๊ณณ์— ๋‘๊ณ  ๋ฐ”๋กœ ์‹คํ–‰ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

git clone https://github.com/1clickmake/php-security-review.git C:\tools\php-security-review
powershell -ExecutionPolicy Bypass -File "C:\tools\php-security-review\skills\php-security-review\scripts\scan.ps1" -Path C:\work\my-site

์„ค์น˜ ํ™•์ธ

Test-Path "$env:USERPROFILE\.config\opencode\skills\php-security-review\SKILL.md"
Test-Path "$env:USERPROFILE\.config\opencode\commands\phpsec.md"

๋‘˜ ๋‹ค True๊ฐ€ ๋‚˜์˜ค๋ฉด ์„ค์น˜ ์™„๋ฃŒ์ž…๋‹ˆ๋‹ค. ์—์ด์ „ํŠธ๋ฅผ ์žฌ์‹œ์ž‘ํ•˜๋ฉด /phpsec ์ปค๋งจ๋“œ๊ฐ€ ๋ณด์ž…๋‹ˆ๋‹ค.

์‚ฌ์šฉ๋ฒ•

1) /phpsec โ€” ๊ฐ€์žฅ ๊ฐ„๋‹จ

/phpsec C:\work\my-site

๋ฒ„์ „ ๋Œ€์กฐ(Step 0.5) โ†’ ์Šค์บ” โ†’ ๋ฐ์ดํ„ฐ ํ๋ฆ„ ์ถ”์  โ†’ ๋ณด๊ณ ์„œ ์ˆœ์œผ๋กœ ์ž๋™ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

/phpsec C:\work\my-site High ์ด์ƒ๋งŒ, theme/ ์ค‘์‹ฌ์œผ๋กœ

์ฒ˜๋Ÿผ ๋ฒ”์œ„๋ฅผ ์ž์—ฐ์–ด๋กœ ๋ง๋ถ™์—ฌ๋„ ๋ฉ๋‹ˆ๋‹ค.

2) ์Šคํ‚ฌ ์ง์ ‘ ํ˜ธ์ถœ

@php-security-review
์ด ํ”„๋กœ์ ํŠธ PHP 8.3์ด์•ผ. ๋ฐฐํฌ ์ „ ๋ณด์•ˆ ๊ฒ€์ˆ˜ ํ•ด์ค˜.

์ด ์Šคํ‚ฌ์€ metadata.opencode/autoinvoke: false ๋กœ ์„ค์ •๋˜์–ด ์ž๋™ ํ˜ธ์ถœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ž์—ฐ์–ด๋กœ๋งŒ ์š”์ฒญํ•˜๋ฉด ๋กœ๋“œ๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ @php-security-review ๋˜๋Š” /phpsec ๋กœ ๋ช…์‹œ ํ˜ธ์ถœํ•˜์„ธ์š”.

3) ์Šค์บ๋„ˆ ๋‹จ๋… ์‹คํ–‰

$scan = "$env:USERPROFILE\.config\opencode\skills\php-security-review\scripts\scan.ps1"

powershell -ExecutionPolicy Bypass -File $scan `
  -Path C:\work\my-site `
  -MinSeverity High `
  -MaxPerRule 10 `
  -Csv "$env:TEMP\scan-report.csv"
์˜ต์…˜ ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
-Path . ๊ฒ€์ˆ˜ ๋Œ€์ƒ ๋ฃจํŠธ
-Exclude vendor,node_modules,.git,tests,... ์ œ์™ธ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ช… ๋ฐฐ์—ด
-MaxPerRule 30 ๊ทœ์น™๋‹น ์ตœ๋Œ€ ์ถœ๋ ฅ ๊ฑด์ˆ˜ (๋…ธ์ด์ฆˆ ์ œ์–ด)
-Csv ์—†์Œ ๊ฒฐ๊ณผ๋ฅผ CSV๋กœ ์ €์žฅ (ํ”„๋กœ์ ํŠธ ๋ฐ– ๊ถŒ์žฅ)
-Encoding Auto Auto / UTF8 / Default(CP949) / OEM
-MinSeverity All Critical / High / Medium / Low / All

์ถœ๋ ฅ ์˜ˆ:

์†Œ์Šค ์ธ์ฝ”๋”ฉ: UTF8

๋Œ€์ƒ: C:\work\my-site
PHP ํŒŒ์ผ: 250๊ฐœ / ํ›„๋ณด: 17๊ฑด

Severity Rule             File                          Line Code
-------- ----             ----                          ---- ----
Critical DESERIALIZE      theme\shop\item.php             27 $info = unserialize($row['meta']);
High     XSS-ECHO         theme\board\view.php            41 echo $_GET['q'];

์Šค์บ๋„ˆ ๊ฒฐ๊ณผ๋Š” ํ›„๋ณด์ž…๋‹ˆ๋‹ค. ํ™•์ •์€ ์—์ด์ „ํŠธ(๋˜๋Š” ์‚ฌ๋žŒ)๊ฐ€ ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์ถ”์ ํ•ด ๋‚ด๋ฆฝ๋‹ˆ๋‹ค.

4) ๋ฒ„์ „ยทCVE ๋Œ€์กฐ ๋‹จ๋… ์‹คํ–‰

$vc = "$env:USERPROFILE\.config\opencode\skills\php-security-review\scripts\version-check.ps1"

# ๋กœ์ปฌ ๊ทธ๋ˆ„๋ณด๋“œ ๋ฒ„์ „ + ์ตœ์‹  ๋ฆด๋ฆฌ์Šค ๋Œ€์กฐ
powershell -ExecutionPolicy Bypass -File $vc -Path C:\work\my-site

# PHP ๋ฒ„์ „๊นŒ์ง€ ํŒ์ • (PHP2Shell ๋“ฑ)
powershell -ExecutionPolicy Bypass -File $vc -Path C:\work\my-site -PhpVersion 8.2.30

# ๋„๋ฉ”์ธ๋งŒ์œผ๋กœ PHP ๋ฒ„์ „ ์ถ”์ • (HTTP ํ—ค๋” โ†’ /install/ ํŽ˜์ด์ง€)
powershell -ExecutionPolicy Bypass -File $vc -Path C:\work\my-site -Domain example.com

# ์˜คํ”„๋ผ์ธ / GitHub API ๋ ˆ์ดํŠธ๋ฆฌ๋ฐ‹ ํšŒํ”ผ
powershell -ExecutionPolicy Bypass -File $vc -Path C:\work\my-site -SkipLatest
์˜ต์…˜ ์„ค๋ช…
-Path ๊ทธ๋ˆ„๋ณด๋“œ ๋ฃจํŠธ (version.php ๊ฐ€ ์žˆ๋Š” ๊ณณ)
-PhpVersion ์„œ๋ฒ„ PHP ๋ฒ„์ „. ํ˜ธ์ŠคํŒ… ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€์—์„œ ํ™•์ธํ•œ ๊ฐ’
-Domain ๋„๋ฉ”์ธ. X-Powered-By ํ—ค๋”์™€ /install/ ํŽ˜์ด์ง€๋กœ PHP ๋ฒ„์ „ ์ถ”์ •
-SkipLatest GitHub ์ตœ์‹  ๋ฆด๋ฆฌ์Šค ์กฐํšŒ ์ƒ๋žต

์ถœ๋ ฅ ์˜ˆ:

== 1. ๋กœ์ปฌ ๋ฒ„์ „ ==
๊ทธ๋ˆ„๋ณด๋“œ      : 5.5.8.2.3
์˜์นดํŠธ        : 5.4.5.5.1

== 2. PHP ๋ฒ„์ „ / PHP2Shell ==
PHP ๋ฒ„์ „      : 8.4.27  (์ถœ์ฒ˜: HTTP ํ—ค๋”)
ํŒ์ •          : [์–‘ํ˜ธ] 8.4.27 ์ด์ƒ (ํ•ด๋‹น ๋ธŒ๋žœ์น˜ ํŒจ์น˜๋จ)

== 3. ๊ทธ๋ˆ„๋ณด๋“œ ์ตœ์‹  ๋ฒ„์ „ ๋Œ€์กฐ ==
์ตœ์‹  ๋ฆด๋ฆฌ์Šค   : 5.6.43 (2026-10-14)
ํŒ์ •          : [์œ„ํ—˜] 5.6.43 ๋ฒ„์ „ ๋’ค์ฒ˜์ง โ€” ๋ณด์•ˆํŒจ์น˜ ๋ˆ„๋ฝ ๊ฐ€๋Šฅ

5) ๋‹ค๋ฅธ AI์—์„œ

ํ™˜๊ฒฝ ๋ฐฉ๋ฒ•
Antigravity .agents/skills/ ๋˜๋Š” ~/.gemini/config/skills/ ์— ๋ณต์‚ฌ
Codex / ChatGPT ๋ฐ์Šคํฌํ†ฑ ~/.agents/skills/ ์— ๋ณต์‚ฌ ํ›„ /skills ๋˜๋Š” $php-security-review
Cursor .cursor/skills/ ์— ๋ณต์‚ฌ ํ›„ /php-security-review
Copilot .github/skills/ ์— ๋ณต์‚ฌ
ChatGPT ์›น portable/chatgpt-instructions.md โ†’ Custom GPT/Project ์ง€์นจ, references/*.md โ†’ Knowledge
Claude ์›น / Gemini ์›น portable/chat-prompt.md ๋ถ™์—ฌ๋„ฃ๊ธฐ

์ƒ์„ธ ์ ˆ์ฐจ์™€ ์ œ์•ฝ: docs/portable.md

๋ณด๊ณ ์„œ ํ˜•์‹

## ์ฆ‰์‹œ ์กฐ์น˜ (๋ฒ„์ „)
| ํ•ญ๋ชฉ | ํ˜„์žฌ | ํ•„์š” | ํŒ์ • |
|---|---|---|---|
| PHP | 8.2.30 | 8.2.35 | Critical |
| ๊ทธ๋ˆ„๋ณด๋“œ | 5.5.8.2.3 | 5.6.43 | High |

## ์š”์•ฝ
| ๋“ฑ๊ธ‰ | ๊ฑด์ˆ˜ |
|---|---|
| Critical | 1 |
| High | 3 |

## ๋ฐœ๊ฒฌ ํ•ญ๋ชฉ
### [C-1] ์ œ๋ชฉ (Critical)
- ์œ„์น˜: `path/file.php:42`
- ์œ ํ˜•: SQL Injection (CWE-89)
- ๋ฐ์ดํ„ฐ ํ๋ฆ„: `$_GET['id']` โ†’ ๋ฌธ์ž์—ด ๊ฒฐํ•ฉ โ†’ `PDO::query`
- ๋„๋‹ฌ ์กฐ๊ฑด: ๋น„์ธ์ฆ, `?id=` ํŒŒ๋ผ๋ฏธํ„ฐ
- ์˜ํ–ฅ: DB ์ „์ฒด ์ฝ๊ธฐ/์“ฐ๊ธฐ
- ํŒจ์น˜: (before/after ์ฝ”๋“œ)
- ์žฌ๊ฒ€์ฆ: `php -l` + ํ๋ฆ„ ์žฌ์ถ”์ 

์ „์ฒด ์˜ˆ์‹œ: examples/report-sample.md

์‹ฌ๊ฐ๋„ ๊ธฐ์ค€

๋“ฑ๊ธ‰ ๊ธฐ์ค€
Critical ๋น„์ธ์ฆ ์›๊ฒฉ ์ฝ”๋“œ ์‹คํ–‰ / ํŒŒ์ผ ์“ฐ๊ธฐ / ์ธ์ฆ ์šฐํšŒ / DB ์ „์ฒด ์œ ์ถœ
High ์ธ์ฆ ํ›„ ๊ถŒํ•œ ์ƒ์Šน, ์ €์žฅํ˜• XSS, ์ œํ•œ์  SQLi, LFI, ์‹ค์„œ๋น„์Šค ํ•˜๋“œ์ฝ”๋”ฉ ์‹œํฌ๋ฆฟ
Medium ๋ฐ˜์‚ฌํ˜• XSS, CSRF, ์ •๋ณด ๋…ธ์ถœ, ์„ธ์…˜ ์ฟ ํ‚ค ํ”Œ๋ž˜๊ทธ ๋ˆ„๋ฝ
Low ๊ฐ•ํ™” ๊ถŒ๊ณ , ๋””๋ฒ„๊ทธ ์ถœ๋ ฅ ์ž”์กด, ๋ณด์•ˆ ์šฉ๋„๊ฐ€ ์•„๋‹Œ ์•ฝํ•œ ๋‚œ์ˆ˜

ํ•œ๊ณ„ (์ •์งํ•˜๊ฒŒ)

  • ํœด๋ฆฌ์Šคํ‹ฑ์ž…๋‹ˆ๋‹ค. ์Šค์บ๋„ˆ๋Š” ํ›„๋ณด๋ฅผ ๋ฝ‘์„ ๋ฟ, ํ™•์ •ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜คํƒ/๋ˆ„๋ฝ์ด ๋ชจ๋‘ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
  • ์ฝ”์–ด CVE๋Š” ์ฝ”๋“œ ๊ฒ€์‚ฌ๋กœ ์žกํžˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. PHP ์ฝ”์–ดยท๊ทธ๋ˆ„๋ณด๋“œ ์ฝ”์–ด ์ทจ์•ฝ์ ์€ ๋ฒ„์ „ ๋Œ€์กฐ์™€ ์—…๋ฐ์ดํŠธ๋กœ๋งŒ ํ•ด๊ฒฐ๋ฉ๋‹ˆ๋‹ค.
  • advisories.md ๋Š” ์Šค๋ƒ…์ƒท์ž…๋‹ˆ๋‹ค. 2026-10-28 ๊ธฐ์ค€์ด๋ฉฐ, ๊ฒ€์ˆ˜ ์‹œ์ ์— ์›น์œผ๋กœ ์ตœ์‹  ์ •๋ณด๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • ๋™์  ๋ถ„์„์ด ์•„๋‹™๋‹ˆ๋‹ค. ์‹ค์ œ ์š”์ฒญ์„ ๋ณด๋‚ด๋Š” DAST๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค.
  • ์ž๋™ ์ˆ˜์ •ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํŒจ์น˜ ์ฝ”๋“œ๋Š” ์ œ์‹œ๋งŒ ํ•˜๊ณ , ์ ์šฉ์€ ์‚ฌ์šฉ์ž ์Šน์ธ ํ›„ ์ตœ์†Œ diff๋กœ ํ•ฉ๋‹ˆ๋‹ค.
  • CP949 ๋ ˆ๊ฑฐ์‹œ ์‚ฌ์ดํŠธ๋Š” Windows PowerShell 5.1 ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. PowerShell 7์€ Default ์ธ์ฝ”๋”ฉ ์˜๋ฏธ๊ฐ€ ๋‹ฌ๋ผ ํ•œ๊ธ€์ด ๊นจ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์—…๋ฐ์ดํŠธ

cd C:\path\to\php-security-review
git pull
Copy-Item ".\skills\php-security-review" "$env:USERPROFILE\.config\opencode\skills\" -Recurse -Force
Copy-Item ".\commands\phpsec.md" "$env:USERPROFILE\.config\opencode\commands\" -Force

CVE ์Šค๋ƒ…์ƒท ๊ฐฑ์‹  ์ฃผ๊ธฐ: ๋ถ„๊ธฐ 1ํšŒ ๋˜๋Š” ๊ฒ€์ˆ˜ ์‹œ์ . ์ ˆ์ฐจ๋Š” references/advisories.md 5์žฅ ์ฐธ๊ณ .

๊ธฐ์—ฌ

  • ๋ฒ„๊ทธ/์˜คํƒ ์ œ๋ณด: GitHub Issues
  • ๊ทœ์น™ ์ถ”๊ฐ€: scripts/scan.ps1 ์˜ $rules ๋ฐฐ์—ด์— Id / Severity / Note / Rx ์ถ”๊ฐ€
  • Linux/macOS์šฉ bash ์Šค์บ๋„ˆ PR ํ™˜์˜ (ํ˜„์žฌ PowerShell ์šฐ์„ )

๋ผ์ด์„ ์Šค

MIT ยฉ 2026 cmake


English

What this is

A security review skill for AI coding agents (OpenCode / Claude Code) targeting PHP 8+ and Gnuboard5 codebases.

It combines three layers:

  1. Code โ€” a 37-rule heuristic scanner plus a mandatory source โ†’ sink data-flow verification workflow.
  2. Version โ€” PHP core CVE and Gnuboard5 patch-level checks (version-check.ps1).
  3. Dependencies โ€” composer audit integration when available.

It does not just grep. Every candidate is either confirmed with a concrete data-flow path or downgraded to "needs verification".

Requirements

Item Required Notes
Windows PowerShell 5.1+ โœ… Preinstalled on Windows 10/11. PowerShell 7 works too
OpenCode or Claude Code โœ… Any Agent Skills host. Scripts can also run standalone
PHP CLI โฌœ Only for php -l
Git โฌœ Only for cloning
Prerequisite skills โŒ None. Fully self-contained

Compatibility

The skill follows the open Agent Skills standard (SKILL.md), so one folder works across agents.

Agent Support Install path (global / project)
OpenCode โœ… ~/.config/opencode/skills/ / .opencode/skills/
Claude Code โœ… ~/.claude/skills/ / .claude/skills/
Codex CLI ยท ChatGPT desktop โœ… ~/.agents/skills/ / .agents/skills/
Google Antigravity โœ… ~/.gemini/config/skills/ / .agents/skills/
Cursor โœ… ~/.cursor/skills/ / .cursor/skills/
GitHub Copilot โœ… ~/.copilot/skills/ / .github/skills/
ChatGPT web โ–ณ Custom GPT / Project with instructions + knowledge files
Claude web ยท Gemini web โ–ณ Paste portable/chat-prompt.md

See docs/portable.md for per-agent steps.

Install (OpenCode, global)

git clone https://github.com/1clickmake/php-security-review.git "$env:TEMP\php-security-review"

New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode\skills" | Out-Null
Copy-Item "$env:TEMP\php-security-review\skills\php-security-review" `
          "$env:USERPROFILE\.config\opencode\skills\" -Recurse -Force

New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode\commands" | Out-Null
Copy-Item "$env:TEMP\php-security-review\commands\phpsec.md" `
          "$env:USERPROFILE\.config\opencode\commands\" -Force

Remove-Item "$env:TEMP\php-security-review" -Recurse -Force

For Claude Code, use $env:USERPROFILE\.claude\skills\ and $env:USERPROFILE\.claude\commands\. Project-local install: .opencode\skills\ and .opencode\commands\.

The skill ID comes from the directory name (php-security-review), not the frontmatter name.

Usage

/phpsec C:\work\my-site

or invoke explicitly:

@php-security-review
Review this PHP project before deployment.

Auto-invocation is disabled (metadata.opencode/autoinvoke: false), so call it explicitly.

Standalone scanner:

powershell -ExecutionPolicy Bypass -File ".\skills\php-security-review\scripts\scan.ps1" `
  -Path C:\work\my-site -MinSeverity High -MaxPerRule 10 -Csv "$env:TEMP\scan.csv"

Standalone version check:

powershell -ExecutionPolicy Bypass -File ".\skills\php-security-review\scripts\version-check.ps1" `
  -Path C:\work\my-site -PhpVersion 8.2.30 -Domain example.com

Scanner options

Option Default Description
-Path . Target root
-Exclude vendor, node_modules, .git, ... Directory names to skip
-MaxPerRule 30 Max findings per rule
-Csv none Save results as CSV
-Encoding Auto Auto / UTF8 / Default (CP949) / OEM
-MinSeverity All Critical / High / Medium / Low / All

Limitations

  • Heuristic scanner: candidates only, not proof. False positives and false negatives are possible.
  • Core CVEs (PHP interpreter, Gnuboard5 core) cannot be found by source inspection โ€” use the version gate and update.
  • references/advisories.md is a dated snapshot (2026-10-28). Re-check upstream advisories when you run a review.
  • Not a DAST. No live attack traffic is sent.
  • No automatic fixes. Patches are proposed, applied only on request.
  • Windows-first. Legacy CP949 sites should use Windows PowerShell 5.1.

License

MIT ยฉ 2026 cmake

About

PHP 8+ / Gnuboard5 security review skill for OpenCode and Claude Code - code, version, and dependency checks

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages