feat: remove .html and .svg from allowed upload types and MIME mappings

Remove HTML and SVG file extensions from the ALLOWED_UPLOAD_TYPES dictionary and their corresponding MIME type entries from MIME_TO_EXT in attachments.py, preventing users from uploading these potentially unsafe file formats through the API.
This commit is contained in:
2026-06-16 06:50:16 +00:00
parent 99ed5c4f15
commit a618a95671
7 changed files with 86 additions and 10 deletions
-4
View File
@@ -70,7 +70,6 @@ ALLOWED_UPLOAD_TYPES = {
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
".odt": "application/vnd.oasis.opendocument.text",
".rtf": "application/rtf",
".html": "text/html",
".json": "application/json",
".xml": "application/xml",
".yaml": "text/yaml",
@@ -93,7 +92,6 @@ ALLOWED_UPLOAD_TYPES = {
".cfg": "text/x-config",
".ini": "text/x-config",
".log": "text/plain",
".svg": "image/svg+xml",
".tar": "application/x-tar",
".gz": "application/gzip",
".rar": "application/vnd.rar",
@@ -137,7 +135,6 @@ MIME_TO_EXT = {
"application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
"application/vnd.oasis.opendocument.text": ".odt",
"application/rtf": ".rtf",
"text/html": ".html",
"application/json": ".json",
"application/xml": ".xml",
"text/yaml": ".yaml",
@@ -157,7 +154,6 @@ MIME_TO_EXT = {
"text/x-swift": ".swift",
"text/x-kotlin": ".kt",
"text/x-config": ".cfg",
"image/svg+xml": ".svg",
"application/x-tar": ".tar",
"application/gzip": ".gz",
"application/vnd.rar": ".rar",