Skip to content

Reject unknown user actions instead of silently returning 200 - #1015

Open
mehdi-shokohi wants to merge 1 commit into
jmpsec:developfrom
Venapce:fix/user-action-unknown-default
Open

Reject unknown user actions instead of silently returning 200#1015
mehdi-shokohi wants to merge 1 commit into
jmpsec:developfrom
Venapce:fix/user-action-unknown-default

Conversation

@mehdi-shokohi

Copy link
Copy Markdown
Contributor

UserActionHandler switches on the {action} path segment but had no default case. An unrecognized action (e.g. "update") matched none of add/edit/remove, skipped every branch, and still fell through to the trailing HTTPResponse — returning 200 {"data":""} while creating, editing, or removing nothing. Callers reasonably read the 200 as success, so a typo'd action silently no-ops.

Add a default case that returns 400 "invalid action".

@javuto javuto added the 🔐 security Security related issues label Sep 3, 2026
@javuto
javuto self-requested a review September 3, 2026 08:29
@javuto javuto added the osctrl-api osctrl-api related changes label Sep 3, 2026
@javuto

javuto commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR! I can amend the signature, but in the future, please do sign your commits. Thanks again!

@javuto

javuto commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Actually I can not amend it, since it comes from your fork. Can you sign the commit please? Thanks!

@javuto javuto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please sign the commit, thanks!

@mehdi-shokohi
mehdi-shokohi requested a review from javuto September 4, 2026 21:52

@javuto javuto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please sign the commit to be able to merge, thanks!

UserActionHandler switches on the {action} path segment but had no
default case. An unrecognized action (e.g. "update") matched none of
add/edit/remove, skipped every branch, and still fell through to the
trailing HTTPResponse — returning 200 {"data":""} while creating,
editing, or removing nothing. Callers reasonably read the 200 as
success, so a typo'd action silently no-ops.

Add a default case that returns 400 "invalid action".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mehdi-shokohi
mehdi-shokohi force-pushed the fix/user-action-unknown-default branch from ba7d605 to bc77368 Compare September 5, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

osctrl-api osctrl-api related changes 🔐 security Security related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants