path traversal exploit fix from upstream
All checks were successful
Build and publish the docker image / build (push) Successful in 1m4s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-03-09 04:31:02 +03:00
parent e9bbc0f307
commit 7a4806c5a3
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D

View File

@ -12,11 +12,16 @@ new favicon($_GET["s"]);
class favicon{
public function __construct($url){
header("Content-Type: image/png");
if(substr_count($url, "/") !== 2){
if(
preg_match(
'/^https?:\/\/[A-Za-z0-9.-]+$/',
$url
) === 0
){
header("X-Error: Only provide the protocol and domain");
$this->defaulticon();
}