Skip to content

Node.js based forum software built for the modern web

Merge branch 'master' into develop

Barış Soner Uşaklıef89dc618ff2
diff --cc public/language/en-GB/admin/settings/uploads.json
index 84e30f535a,c1c6c31e36..b1b41e71e0
--- a/public/language/en-GB/admin/settings/uploads.json
+++ b/public/language/en-GB/admin/settings/uploads.json
@@@ -29,10 -29,9 +29,11 @@@
"allow-topic-thumbnails": "Allow users to upload topic thumbnails",
"show-post-uploads-as-thumbnails": "Show post uploads as thumbnails",
"topic-thumb-size": "Topic Thumb Size",
- "allowed-file-extensions": "Allowed File Extensions",
- "allowed-file-extensions-help": "Enter comma-separated list of file extensions here (e.g. <code>pdf,xls,doc</code>). An empty list means all extensions are allowed.",
+ "allowed-file-extensions": "Allowed File Extensions (Whitelist)",
+ "allowed-file-extensions-help": "Comma-separated list of extensions permitted for upload (e.g. <code>pdf,xls,doc</code>). Leave empty to allow all extensions. Note: the blocked list below takes priority — an extension present in both lists will be rejected.",
+ "allowed-file-extension-warning": "Warning: Allowing all file extensions can be dangerous. NodeBB will attempt to mitigate risks by serving files with certain extensions as attachments. If you are using a reverse proxy, you should also ensure it serves files with dangerous extensions as attachments.",
+ "blocked-file-extensions": "Blocked File Extensions (Blacklist)",
+ "blocked-file-extensions-help": "Comma-separated list of extensions that are always rejected (e.g. <code>html,svg,php</code>). The blocked list takes priority over the allowed list — if an extension appears in both, it will be rejected.",
"upload-limit-threshold": "Rate limit user uploads to:",
"upload-limit-threshold-per-minute": "Per %1 Minute",
"upload-limit-threshold-per-minutes": "Per %1 Minutes",
diff --cc src/views/admin/settings/uploads.tpl
index fccb51eb98,f59210b584..0df1074801
--- a/src/views/admin/settings/uploads.tpl
+++ b/src/views/admin/settings/uploads.tpl
@@@ -114,16 -114,11 +114,19 @@@
<p class="form-text">
[[admin/settings/uploads:allowed-file-extensions-help]]
</p>
+ <div class="alert alert-warning text-sm alert-dismissible fade show mb-0" role="alert">
+ [[admin/settings/uploads:allowed-file-extension-warning]]
+ </div>
</div>
+ <div class="mb-3">
+ <label class="form-label" for="blockedFileExtensions">[[admin/settings/uploads:blocked-file-extensions]]</label>
+ <input id="blockedFileExtensions" type="text" class="form-control" value="" data-field="blockedFileExtensions" data-field-type="tagsinput" />
+ <p class="form-text">
+ [[admin/settings/uploads:blocked-file-extensions-help]]
+ </p>
+ </div>
+
<div class="mb-3">
<label class="form-label" for="uploadRateLimitThreshold">[[admin/settings/uploads:upload-limit-threshold]]</label>
<div id="uploadRateLimitThreshold" class="row">