Skip to content

Commit bb0fe30

Browse files
authored
Block sensitive file extensions in early 404 guard (#605)
1 parent 61d29ea commit bb0fe30

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

public/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
'mp3', 'mp4', 'ogg', 'webm', 'wav', 'flac', 'aac', 'm4a', 'm4v', 'ogv', 'mov',
2626
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
2727
'zip', 'gz', 'tar', 'rar', '7z',
28+
'sql', 'sqlite', 'db', 'mdb', 'log', 'bak', 'backup', 'old', 'orig', 'swp', 'swo',
29+
'phtml', 'phar', 'sh', 'bash', 'py', 'pl', 'rb', 'cgi',
30+
'key', 'pem', 'crt', 'cer', 'p12', 'pfx',
31+
'yaml', 'yml', 'toml', 'ini', 'conf', 'env', 'htaccess', 'htpasswd',
2832
];
2933
if (in_array($ext, $staticExts, true)) {
3034
http_response_code(404);

0 commit comments

Comments
 (0)