Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(security): validate bot access #365

Merged
merged 2 commits into from
Jul 15, 2022
Merged

fix(security): validate bot access #365

merged 2 commits into from
Jul 15, 2022

Conversation

EFF
Copy link
Member

@EFF EFF commented Jul 14, 2022

This simple PR ensures that a user really has access to a bot targeted by a request. Before this change, a user could perform some actions on a chatbot from a foreign workspace.

@@ -141,6 +133,10 @@ const checkPermissions =
return new ForbiddenError(`User "${email}" doesn't have access to workspace "${req.workspace}"`)
}

if (req.params.botId && !(await workspaceService.isBotInWorkspace(req.workspace, req.params.botId))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we don't also need to check that req.params.botId !== '___'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ✅

@EFF EFF merged commit fd6bc0c into master Jul 15, 2022
@laurentlp laurentlp deleted the f_workspace-scurity branch July 26, 2022 17:30
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.

None yet

2 participants