Skip to content

fix(bvm): gate BVM_DELETEABILITY + BVM_DELETEQUEST behind privilege check#563

Merged
CoreyRDean merged 1 commit into
developfrom
harden/bvm-ungated-mutators
Jun 10, 2026
Merged

fix(bvm): gate BVM_DELETEABILITY + BVM_DELETEQUEST behind privilege check#563
CoreyRDean merged 1 commit into
developfrom
harden/bvm-ungated-mutators

Conversation

@CoreyRDean

Copy link
Copy Markdown
Collaborator

Summary

Closes an equivalent-effect privilege-gate bypass (CLAUDE.md §privilege gating, category 4): two state-mutating BVM commands lacked the gate their documented siblings already carry.

  • BVM_DELETEABILITY — strips an ability/spell from any actor handle (sibling BVM_SETABILITYLEVEL is gated)
  • BVM_DELETEQUEST — wipes a target's quest-log entry

Both now begin with If Not BVM_RequirePrivileged() Then Return (full-priv; both have zero shipped callers, so the strict gate breaks nothing). Adds 6 BVMPrivilegeGateTest.bb cases and regenerates docs/bvm-reference.md.

Test plan

  • compile.bat -t clean (all 5 engine targets)
  • test.bat green (51/51) incl. BVMPrivilegeGateTest
  • scripts/gen_bvm_reference.sh --check exits 0
  • RC_Standard_Invoker.bb untouched (no opcode renumber); data/ grep shows no callers

…heck

Both functions take an actor/target handle and destroy persistent player
state (a learned ability, a quest-log entry) but lacked the privilege gate
their equivalent-effect siblings already carry (BVM_SETABILITYLEVEL and the
quest/progression mutators). A non-privileged clicker-driven script
(Examine/Trade/RightClick/ItemScript) sets SI\AI = Handle(clicker), so a
self-or-priv gate would let DeleteAbility(clicker, ...) / DeleteQuest(clicker,
...) through. Use the full BVM_RequirePrivileged() gate. No shipped content
scripts in data/ call either function (verified), so the gate breaks nothing.

Adds regression cases to BVMPrivilegeGateTest.bb and regenerates
docs/bvm-reference.md (CI staleness gate).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CoreyRDean CoreyRDean requested a review from a team as a code owner June 10, 2026 16:42
@CoreyRDean CoreyRDean merged commit 7602ef0 into develop Jun 10, 2026
1 check passed
@CoreyRDean CoreyRDean deleted the harden/bvm-ungated-mutators branch June 10, 2026 16:48
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.

1 participant