Download the PHP package ctrbts/secure-timthumb without Composer
On this page you can find all versions of the php package ctrbts/secure-timthumb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package secure-timthumb
Secure TimThumb (Modern Refactor)
A secure, modern rewrite of the timthumb.php script. This project aims to provide a drop-in replacement for legacy systems that still rely on TimThumb, mitigating the critical RCE and file inclusion vulnerabilities present in the original version.
⚠️ WARNING: This library is intended for legacy maintenance. For new projects, maybe you prefer a modern solutions like Intervention Image or cloud-based services.
Key Security Improvements
- Strict MIME Type Checking: Uses finfo to validate magic bytes. Malicious files renamed to
.jpgwill be rejected. - No Webshots: The vulnerable
exec()based website screenshot feature has been removed entirely. - External Sites Disabled by Default: Must be explicitly enabled via config.
- SSRF Protection: cURL is restricted to HTTP/HTTPS protocols only to prevent internal network scanning.
- Cache Execution Prevention: Automatically generates an
.htaccessin the cache directory to prevent PHP execution.
Installation
Option A:
Composer (Recommended)
Option B:
Drop-in Replacement (Manual)
- Download
TimThumb.phpfrom this repository. - Replace your existing
timthumb.phpfile. - Ensure the cache directory exists and is writable by the web server.
Configuration
You can configure the script by instantiating the class with an array of options (if using as a library) or by editing the default config array at the top of the TimThumb.php file (if using as a standalone script).
Attribution & Transparency
Maintainer: Fernando Merlo Original Authors: Ben Gillbanks & Mark Maunder
Refactor Note: This codebase was refactored with the assistance of AI tools to analyze historical security flaws and implement modern PHP security standards (PSR, Strict Types, Exception Handling).
Disclaimer: This software is provided "as is", without warranty of any kind. Use at your own risk.
All versions of secure-timthumb with dependencies
ext-gd Version *
ext-curl Version *
ext-fileinfo Version *
ext-json Version *