From 82c421f4581436c30b630969629f0932f77afdce Mon Sep 17 00:00:00 2001 From: Quinten Date: Tue, 11 Nov 2025 16:29:19 +0100 Subject: [PATCH] fix: refine CGI path validation to exclude relative paths --- webserv/config/AConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webserv/config/AConfig.cpp b/webserv/config/AConfig.cpp index e9a3796..0b21f26 100644 --- a/webserv/config/AConfig.cpp +++ b/webserv/config/AConfig.cpp @@ -181,7 +181,7 @@ std::string AConfig::getCGIPath(const std::string &extension) const } auto exts = directive->getValue().try_get>().value(); auto cgiPath = exts.back(); - if (cgiPath.starts_with(".")) + if (cgiPath.starts_with(".") && !cgiPath.starts_with("./")) { continue; }