{"id":20672790,"url":"https://github.com/selective-php/archive-bomb-scanner","last_synced_at":"2025-08-16T23:07:00.883Z","repository":{"id":45403258,"uuid":"199143082","full_name":"selective-php/archive-bomb-scanner","owner":"selective-php","description":"Archive bomb scanner","archived":false,"fork":false,"pushed_at":"2023-09-09T12:31:54.000Z","size":1503,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T20:22:03.867Z","etag":null,"topics":["archive-bomb-scanner","php","png","png-bomb-scanner","png-bombs","rar-bomb","rar-bomb-scanner","security","zip-bomb","zip-bomb-scanner"],"latest_commit_sha":null,"homepage":null,"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/selective-php.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}},"created_at":"2019-07-27T09:17:31.000Z","updated_at":"2024-02-20T02:03:44.000Z","dependencies_parsed_at":"2023-01-22T14:30:17.255Z","dependency_job_id":null,"html_url":"https://github.com/selective-php/archive-bomb-scanner","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Farchive-bomb-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Farchive-bomb-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Farchive-bomb-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selective-php%2Farchive-bomb-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selective-php","download_url":"https://codeload.github.com/selective-php/archive-bomb-scanner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224970156,"owners_count":17400294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["archive-bomb-scanner","php","png","png-bomb-scanner","png-bombs","rar-bomb","rar-bomb-scanner","security","zip-bomb","zip-bomb-scanner"],"created_at":"2024-11-16T20:38:49.021Z","updated_at":"2025-08-16T23:07:00.875Z","avatar_url":"https://github.com/selective-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# selective/archive-bomb-scanner\n\nZIP and PNG bomb scanner for PHP.\n\n[![Latest Version on Packagist](https://img.shields.io/github/release/selective-php/archive-bomb-scanner.svg?style=flat-square)](https://packagist.org/packages/selective/archive-bomb-scanner)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Total Downloads](https://img.shields.io/packagist/dt/selective/archive-bomb-scanner.svg?style=flat-square)](https://packagist.org/packages/selective/archive-bomb-scanner/stats)\n\n## Features\n\n* Detection of ZIP archive bombs\n* Detection of RAR archive bombs\n* Detection of PNG bombs\n* No dependencies\n* Very fast\n\n## Requirements\n\n* PHP 8.1 - 8.4\n\n## Installation\n\n```\ncomposer require selective/archive-bomb-scanner\n```\n\n## Usage\n\n### Scan ZIP file\n\n```php\nuse Selective\\ArchiveBomb\\Scanner\\BombScanner;\nuse Selective\\ArchiveBomb\\Engine\\ZipBombEngine;\nuse SplFileObject;\n\n$file = new SplFileObject('42.zip');\n\n$scanner = new BombScanner();\n$scanner-\u003eaddEngine(new ZipBombEngine());\n\n$scannerResult = $scanner-\u003escanFile($file);\n\nif ($scannerResult-\u003eisBomb()) {\n    echo 'Archive bomb detected!';\n} else {\n    echo 'File is clean';\n}\n```\n\n### Scan in-memory ZIP file\n\n```php\nuse Selective\\ArchiveBomb\\BombScanner;\nuse Selective\\ArchiveBomb\\Engine\\ZipBombEngine;\nuse SplTempFileObject;\n\n$file = new SplTempFileObject();\n\n$file-\u003efwrite('my file content');\n\n$scanner = new BombScanner();\n$scanner-\u003eaddEngine(new ZipBombEngine());\n\n$isBomb = $detector-\u003escanFile($file)-\u003eisBomb(); // true or false\n```\n\n### Scan RAR file\n\n```php\nuse Selective\\ArchiveBomb\\Scanner\\BombScanner;\nuse Selective\\ArchiveBomb\\Engine\\RarBombEngine;\nuse SplFileObject;\n\n$file = new SplFileObject('10GB.rar');\n\n$scanner = new BombScanner();\n$scanner-\u003eaddEngine(new RarBombEngine());\n\n$scannerResult = $scanner-\u003escanFile($file);\n\nif ($scannerResult-\u003eisBomb()) {\n    echo 'Archive bomb detected!';\n} else {\n    echo 'File is clean';\n}\n```\n\n### Scan PNG file\n\n```php\nuse Selective\\ArchiveBomb\\Scanner\\BombScanner;\nuse Selective\\ArchiveBomb\\Engine\\PngBombEngine;\nuse SplFileObject;\n\n$file = new SplFileObject('example.png');\n\n$scanner = new BombScanner();\n$scanner-\u003eaddEngine(new PngBombEngine());\n\n$scannerResult = $scanner-\u003escanFile($file);\n\nif ($scannerResult-\u003eisBomb()) {\n    echo 'PNG bomb detected!';\n} else {\n    echo 'File is clean';\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselective-php%2Farchive-bomb-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselective-php%2Farchive-bomb-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselective-php%2Farchive-bomb-scanner/lists"}