New submission from Siwon Kang <kkangsh...@gmail.com>:

is_cgi() in CGIHTTPRequestHandler class separates given path into (dir, rest) 
then checks if dir is in cgi_directories. However, it divides based on the 
first seen '/', multi-level directories like /sub/dir/cgi-bin/hello.py is 
divided into head=/sub, rest=dir/cgi-bin/hello.py then check whether '/sub' 
exists in cgi_directories = [..., '/sub/dir/cgi-bin'].
If the function divides by last seen '/', it works correctly as 
head=/sub/dir/cgi-bin, rest=hello.py

----------
components: Library (Lib)
files: sample.tar.xz
messages: 357074
nosy: kkangshawn
priority: normal
severity: normal
status: open
title: http.server is_cgi() does not correctly separate dir
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48725/sample.tar.xz

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38863>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to