refactor: Server crash when uploading file without extension; fixes security vulnerability [GHSA-792q-q67h-w579](https://github.com/parse-community/parse-server/security/advisories/GHSA-792q-q67h-w579) (#8779)
This commit is contained in:
@@ -159,9 +159,9 @@ export class FilesRouter {
|
||||
} else if (contentType && contentType.includes('/')) {
|
||||
extension = contentType.split('/')[1];
|
||||
}
|
||||
extension = extension.split(' ').join('');
|
||||
extension = extension?.split(' ')?.join('');
|
||||
|
||||
if (!isValidExtension(extension)) {
|
||||
if (extension && !isValidExtension(extension)) {
|
||||
next(
|
||||
new Parse.Error(
|
||||
Parse.Error.FILE_SAVE_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user