Skip to content

Potential fix for code scanning alert no. 160: Type confusion through parameter tampering#113

Open
perinst wants to merge 1 commit intofeature/mergefrom
hotfix/alert-160
Open

Potential fix for code scanning alert no. 160: Type confusion through parameter tampering#113
perinst wants to merge 1 commit intofeature/mergefrom
hotfix/alert-160

Conversation

@perinst
Copy link
Collaborator

@perinst perinst commented Jun 20, 2025

Potential fix for https://github.com/perinst/dozu-api-service/security/code-scanning/160

To fix the issue, we need to validate the type of req.files in the uploadMultipleFiles method of upload.file.controller.ts. Specifically:

  1. Ensure that req.files is an array and that all its elements are of type Express.Multer.File.
  2. If the validation fails, throw a BadRequest error to prevent further processing.

This fix ensures that only properly formatted arrays of Express.Multer.File objects are passed to the processMultipleFiles method, mitigating the risk of type confusion.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

… parameter tampering

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@perinst perinst marked this pull request as ready for review June 20, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant