fix: require explicit confirmation for destructive operations - #49
Open
codebydaksh wants to merge 1 commit into
Open
fix: require explicit confirmation for destructive operations#49codebydaksh wants to merge 1 commit into
codebydaksh wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: require explicit confirmation for destructive operations
Summary
This PR fixes a security vulnerability in
elicit_or_fallback()where destructiveOkta operations could execute without user confirmation when the MCP client does not
support the elicitation protocol.
Vulnerability
File:
src/okta_mcp_server/utils/elicitation.pyFunction:
elicit_or_fallback()The function accepted an
auto_confirm_on_fallback=Trueparameter that, when set,would return
confirmed=Truewhenever elicitation was unavailable (unsupported client,McpError, or any other exception). This effectively bypassed the confirmationrequirement for all destructive operations that used this flag.
Affected operations (8 total)
deactivate_userusers.pydelete_deactivated_userusers.pydeactivate_applicationapplications.pydeactivate_lifecycle_policypolicies.pydelete_lifecycle_policypolicies.pydeactivate_access_policypolicies.pydelete_access_policypolicies.pydelete_device_assurancedevice_assurance.pyAttack scenario
An MCP client that does not support elicitation (or one that throws an exception
during the elicitation call) would cause every destructive operation above to proceed
immediately without any user confirmation. This violates the principle of least
privilege and could lead to accidental or malicious deletion of users, applications,
and policies.
Fix
When elicitation is not supported or throws an exception, the fallback now
always returns
confirmed=False, requiring the caller to use the legacytwo-tool confirmation flow. The
auto_confirm_on_fallbackparameter is retainedfor API compatibility but is now ignored and marked as deprecated.
Changes
src/okta_mcp_server/utils/elicitation.py: Removed three code paths thatreturned
confirmed=Truewhenauto_confirm_on_fallback=True. Updated docstringto document the new behavior and deprecate the parameter.
CWE References
(confirmation) step when elicitation was unavailable, allowing destructive
operations without the required user consent.
that require explicit user confirmation could proceed without any authentication
of user intent when the elicitation protocol was not available.
Test plan
and the operation only proceeds when the user clicks "Confirm".
confirmed=Falseand aconfirmation_requiredpayload.confirmed=False.pytest tests/elicitation/