You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insufficient API data validation can cause unexpected behavior. The following mutations seem to bypass some frontend validation:
UpdateUserProfile accepts a bio string exceeding the frontend maximum of 100.
UpdateUserProfile accepts an experienceLevel string with any text in it, regardless of whether it appears in the predefined dropdown list.
UpdateUserProfile accepts name being null, subsequent updates to the profile with name null does trigger validation however and the request fails.
UpdateUserProfile accepts any string for image and will attempt to retrieve whatever is entered. For instance I can make my image an external gif (which seems to be unsupported by the frontend). This may enable persistent CSRF or XSS attacks. It does seem however that the Squad image validation does only accept an upload and does not accept links.
UpdateMemberRole allows admins to change their own role.
generateDevCardV2 allows users to change their theme regardless of whether they meet the reputation requirements.
Expected Behavior
The below is what I expected when sending these mutations:
API validates bio and fails when it exceeds 100 characters.
API validates experienceLevel and fails if it is not a predefined value.
API validates name and does not accept null.
API validates image and only accepts an upload.
API validates that [target]memberId != [sendingMemberId] or [targetMemberRole] != admin to prevent admins from changing roles for other admins.
API validates reputation requirements for themes.
Steps to Reproduce Issue
I am going to omit the repro steps to prevent abuse but I am happy to explain further if necessary.
Solution Proposed
Ensure the API validates all user input, ideally at all levels (database, API, client).
Environment
No response
Browsers
No response
OS
No response
Version of daily.dev
No response
Additional Context
Bio, experience level, null name, legendary DevCard with 10 reputation, and gif for image can be observed at https://app.daily.dev/cr4shed. I also have a Squad with no admin which I achieved by changing my own role to moderator https://dly.to/MJBSxmuqRBp.
Code of Conduct
I follow the conditions of this project.
The text was updated successfully, but these errors were encountered:
What went wrong? 🤔
Insufficient API data validation can cause unexpected behavior. The following mutations seem to bypass some frontend validation:
bio
string exceeding the frontend maximum of 100.experienceLevel
string with any text in it, regardless of whether it appears in the predefined dropdown list.name
being null, subsequent updates to the profile withname
null does trigger validation however and the request fails.image
and will attempt to retrieve whatever is entered. For instance I can make my image an external gif (which seems to be unsupported by the frontend). This may enable persistent CSRF or XSS attacks. It does seem however that the Squad image validation does only accept an upload and does not accept links.theme
regardless of whether they meet the reputation requirements.Expected Behavior
The below is what I expected when sending these mutations:
bio
and fails when it exceeds 100 characters.experienceLevel
and fails if it is not a predefined value.name
and does not accept null.image
and only accepts an upload.[target]memberId != [sendingMemberId]
or[targetMemberRole] != admin
to prevent admins from changing roles for other admins.Steps to Reproduce Issue
I am going to omit the repro steps to prevent abuse but I am happy to explain further if necessary.
Solution Proposed
Ensure the API validates all user input, ideally at all levels (database, API, client).
Environment
No response
Browsers
No response
OS
No response
Version of daily.dev
No response
Additional Context
Bio, experience level, null name, legendary DevCard with 10 reputation, and gif for image can be observed at https://app.daily.dev/cr4shed. I also have a Squad with no admin which I achieved by changing my own role to moderator https://dly.to/MJBSxmuqRBp.
Code of Conduct
The text was updated successfully, but these errors were encountered: