{"id":50244233,"url":"https://github.com/rubennati/vulnerable-php-code-examples","last_synced_at":"2026-05-26T22:31:22.018Z","repository":{"id":351894500,"uuid":"194453515","full_name":"rubennati/vulnerable-php-code-examples","owner":"rubennati","description":"Deliberately vulnerable PHP code examples for testing static analysis tools and security training, covering common vulnerabilities such as SQL Injection, XSS, CSRF, and more.","archived":false,"fork":false,"pushed_at":"2026-04-27T00:35:56.000Z","size":338,"stargazers_count":12,"open_issues_count":0,"forks_count":36,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-27T02:28:30.936Z","etag":null,"topics":["owasp","php","security","static-analysis","vulnerable"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubennati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-06-29T22:29:20.000Z","updated_at":"2026-04-27T00:38:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rubennati/vulnerable-php-code-examples","commit_stats":null,"previous_names":["rubennati/vulnerable-php-code-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubennati/vulnerable-php-code-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubennati%2Fvulnerable-php-code-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubennati%2Fvulnerable-php-code-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubennati%2Fvulnerable-php-code-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubennati%2Fvulnerable-php-code-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubennati","download_url":"https://codeload.github.com/rubennati/vulnerable-php-code-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubennati%2Fvulnerable-php-code-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33542350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["owasp","php","security","static-analysis","vulnerable"],"created_at":"2026-05-26T22:31:21.192Z","updated_at":"2026-05-26T22:31:22.009Z","avatar_url":"https://github.com/rubennati.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Vulnerability Examples for Static Analysis\n\nA collection of deliberately vulnerable PHP code examples for use with static analysis tools (SATs), security training, and research.\n\nOriginally created as part of a Master's program project in IT-Security at the University of Applied Sciences Vienna (FH Technikum Wien).\n\n## Vulnerabilities Covered\n\n| File | Vulnerability |\n|------|--------------|\n| `src/sql-injection.php` | SQL Injection (PDO, SQLite) |\n| `src/sql-injection_2.php` | SQL Injection (PDO, SQLite) |\n| `src/cross-site-scripting-xss.php` | Cross-Site Scripting (XSS) |\n| `src/basic-collection.php` | XSS, SQL Injection, Command Injection, Deprecated Functions |\n| `src/path-traversal.php` | Path Traversal / Local File Inclusion |\n| `src/csrf.php` | Cross-Site Request Forgery (CSRF) |\n| `src/insecure-file-upload.php` | Insecure File Upload |\n| `src/idor.php` | Insecure Direct Object Reference (IDOR) |\n| `src/open-redirect.php` | Open Redirect |\n| `src/sensitive-data-exposure.php` | Sensitive Data Exposure (Hardcoded Credentials) |\n| `src/remote-file-inclusion.php` | Remote File Inclusion (RFI) |\n| `src/insecure-deserialization.php` | Insecure Deserialization |\n| `src/xxe.php` | XML External Entity (XXE) |\n| `src/ldap-injection.php` | LDAP Injection |\n| `src/security-misconfiguration.php` | Security Misconfiguration |\n| `src/weak-cryptography.php` | Weak Cryptography |\n| `src/session-fixation.php` | Session Fixation |\n| `src/type-juggling.php` | Type Juggling — Loose Comparison |\n| `src/type-juggling_2.php` | Type Juggling — Type Casting |\n\n### Tool-specific Test Files\n\nFiles under `src/tool-examples/` contain test code tailored to specific SATs:\n\n| File | Tool |\n|------|------|\n| `src/tool-examples/progpilot.php` | [Progpilot](https://github.com/designsecurity/progpilot) |\n| `src/tool-examples/phpcs-security-audit.php` | [phpcs-security-audit](https://github.com/FloeDesignTechnologies/phpcs-security-audit) |\n| `src/tool-examples/php-security-scanner.php` | [php-security-scanner](https://github.com/dustyfresh/PHP-vulnerability-audit-cheatsheet) |\n\n## Usage\n\n```bash\ngit clone https://github.com/rubennati/vulnerable-php-code-examples.git\n```\n\nRun any PHP SAT against the files in `src/`. The SQLite database in `database/` is used by the SQL injection examples.\n\n## Related\n\nBased on research comparing open-source PHP static analysis tools and their effectiveness when combined into a toolchain. The evaluated SATs include Progpilot, phpcs-security-audit, php-security-scanner, OWASP WAP, SonarPHP, RIPS, and others.\n\n**Related projects (FH Technikum Wien, PRJ1/PRJ2):**\n- [vulnerability-code-scanner](https://gitlab.com/FHTW-MCS-PRJ/vulnerability-code-scanner) — Laravel-based toolchain combining the three selected SATs\n- [PHP-Vulnerability-test-suite](https://gitlab.com/FHTW-MCS-PRJ/PHP-Vulnerability-test-suite) — 42,212 PHP test cases (29,258 safe / 12,954 unsafe)\n\n## Warning\n\nThis repository contains intentionally insecure code. Do not deploy or use in production environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubennati%2Fvulnerable-php-code-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubennati%2Fvulnerable-php-code-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubennati%2Fvulnerable-php-code-examples/lists"}