Skip to content

feat(php): add PHP Composer ecosystem support - #2

Merged
lachaib merged 2 commits into
mainfrom
feat/php-composer-ecosystem
Jun 16, 2026
Merged

feat(php): add PHP Composer ecosystem support#2
lachaib merged 2 commits into
mainfrom
feat/php-composer-ecosystem

Conversation

@lachaib

@lachaib lachaib commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds PhpAnalyzer implementing full threat detection for PHP Composer packages via the Packagist registry
  • 36 PHP-specific security patterns covering code execution, shell access, deserialization, obfuscation, network I/O, filesystem writes, environment access, and CI credential targeting
  • Composer lifecycle script detection (post-install-cmd, pre-install-cmd, post-update-cmd, etc.) as install hooks
  • Packagist API client with version resolution, artifact download, registry metadata, and metadata delta computation
  • GitHub zipball top-level directory stripping for consistent cross-version file path comparison
  • php: 'Packagist' added to OSV vulnerability database mapping
  • Packagist public registry URLs (api.github.com, codeload.github.com) added to registry confusion heuristics
  • 'composer-script' added to InstallHook.type union
  • 39 tests: 35 unit tests for patterns + hook detection, 4 integration tests (added, updated, removed, registry change)
  • Bumps lockdelta to ^0.1.4 which includes composer.lock parsing support

Test plan

  • Unit tests: pnpm test — 39/39 pass
  • Type check: pnpm typecheck — no errors
  • Lint: pnpm run check — no errors

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ilter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lachaib
lachaib merged commit 7e8f46d into main Jun 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants