Skip to content

Commit fa245cb

Browse files
authored
fix: Add problematic MIME types to default value of Parse Server option fileUpload.fileExtensions (#9902)
1 parent e9fc20d commit fa245cb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Options/Definitions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,9 +1077,9 @@ module.exports.FileUploadOptions = {
10771077
fileExtensions: {
10781078
env: 'PARSE_SERVER_FILE_UPLOAD_FILE_EXTENSIONS',
10791079
help:
1080-
"Sets the allowed file extensions for uploading files. The extension is defined as an array of file extensions, or a regex pattern.<br><br>It is recommended to restrict the file upload extensions as much as possible. HTML files are especially problematic as they may be used by an attacker who uploads a HTML form to look legitimate under your app's domain name, or to compromise the session token of another user via accessing the browser's local storage.<br><br>Defaults to `^(?!(h|H)(t|T)(m|M)(l|L)?$)` which allows any file extension except HTML files.",
1080+
"Sets the allowed file extensions for uploading files. The extension is defined as an array of file extensions, or a regex pattern.<br><br>It is recommended to restrict the file upload extensions as much as possible. HTML files are especially problematic as they may be used by an attacker who uploads a HTML form to look legitimate under your app's domain name, or to compromise the session token of another user via accessing the browser's local storage.<br><br>Defaults to `^(?![xXsS]?[hH][tT][mM][lL]?$)` which allows any file extension except those MIME types that are mapped to `text/html` and are rendered as website by a web browser.",
10811081
action: parsers.arrayParser,
1082-
default: ['^(?!(h|H)(t|T)(m|M)(l|L)?$)'],
1082+
default: ['^(?![xXsS]?[hH][tT][mM][lL]?$)'],
10831083
},
10841084
};
10851085
module.exports.DatabaseOptions = {

src/Options/docs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ export interface PasswordPolicyOptions {
594594
}
595595

596596
export interface FileUploadOptions {
597-
/* Sets the allowed file extensions for uploading files. The extension is defined as an array of file extensions, or a regex pattern.<br><br>It is recommended to restrict the file upload extensions as much as possible. HTML files are especially problematic as they may be used by an attacker who uploads a HTML form to look legitimate under your app's domain name, or to compromise the session token of another user via accessing the browser's local storage.<br><br>Defaults to `^(?!(h|H)(t|T)(m|M)(l|L)?$)` which allows any file extension except HTML files.
598-
:DEFAULT: ["^(?!(h|H)(t|T)(m|M)(l|L)?$)"] */
597+
/* Sets the allowed file extensions for uploading files. The extension is defined as an array of file extensions, or a regex pattern.<br><br>It is recommended to restrict the file upload extensions as much as possible. HTML files are especially problematic as they may be used by an attacker who uploads a HTML form to look legitimate under your app's domain name, or to compromise the session token of another user via accessing the browser's local storage.<br><br>Defaults to `^(?![xXsS]?[hH][tT][mM][lL]?$)` which allows any file extension except those MIME types that are mapped to `text/html` and are rendered as website by a web browser.
598+
:DEFAULT: ["^(?![xXsS]?[hH][tT][mM][lL]?$)"] */
599599
fileExtensions: ?(string[]);
600600
/* Is true if file upload should be allowed for anonymous users.
601601
:DEFAULT: false */

0 commit comments

Comments
 (0)