Skip to content

Commit

Permalink
Merge pull request #1162 from CVEProject/jd-1159
Browse files Browse the repository at this point in the history
#1159 Prevents possible toString override
  • Loading branch information
david-rocca authored Jan 10, 2024
2 parents eb5bec4 + ceab24d commit 6332611
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controller/org.controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ router.post('/org/:shortname/user',
body(['name.suffix']).optional().isString().trim().isLength({ max: CONSTANTS.MAX_SUFFIX_LENGTH }).withMessage(errorMsgs.SUFFIX_LENGTH),
body(['authority.active_roles']).optional()
.custom(mw.isFlatStringArray)
.bail()
.customSanitizer(toUpperCaseArray)
.custom(isUserRole),
parseError,
Expand Down Expand Up @@ -732,6 +733,7 @@ router.put('/org/:shortname/user/:username',
query(['name.suffix']).optional().isString().trim().isLength({ max: CONSTANTS.MAX_SUFFIX_LENGTH }).withMessage(errorMsgs.SUFFIX_LENGTH),
query(['active_roles.add']).optional().toArray()
.custom(isFlatStringArray)
.bail()
.customSanitizer(toUpperCaseArray)
.custom(isUserRole).withMessage(errorMsgs.USER_ROLES),
query(['active_roles.remove']).optional().toArray()
Expand Down

0 comments on commit 6332611

Please sign in to comment.