Skip to content

CLDSRV-1017: apply each key's own authorization verdict in multiObjectDelete - #6323

Draft
DarkIsDude wants to merge 1 commit into
development/9.5from
bugfix/CLDSRV-1017/multi-object-delete-per-key-authz
Draft

DarkIsDude wants to merge 1 commit into
development/9.5from
bugfix/CLDSRV-1017/multi-object-delete-per-key-authz

Conversation

@DarkIsDude

Copy link
Copy Markdown
Contributor

Description

Motivation and context

When an IAM user sends a DeleteObjects request with several keys, every key gets the authorization result of the last key in the request. If the last key is allowed by the user's policy, keys outside the policy are deleted too (unauthorized data deletion); if the last key is denied, allowed keys get AccessDenied. The same keys sent alone are authorized correctly.

Vault returns one authorization result per key, but multiObjectDelete's checkPolicies step collapsed those results into a map keyed by action. Since every result of a DeleteObjects request shares the same action (objectDelete), the map ended up holding only the last result's isImplicit flag, and evaluateBucketPolicyWithIAM was then called with that same collapsed map for every key.

The fix builds the actionImplicitDenies map per key, from that key's own result, so each key is authorized on its own verdict.

Two regression tests cover both orderings (denied key last, allowed key last); both fail without the fix.

Related issues

Checklist

Add tests to cover the changes

  • Regression tests added in tests/unit/api/multiObjectDelete.js

Code conforms with the style guide

  • eslint and prettier pass on the changed files

@DarkIsDude DarkIsDude self-assigned this Oct 5, 2026
@bert-e

bert-e commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Hello darkisdude,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval ⭐
/bypass_build_status Bypass the build and test status ⭐
/bypass_commit_size Bypass the check on the size of the changeset TBA ⭐
/bypass_incompatible_branch Bypass the check on the source branch prefix ⭐
/bypass_jira_check Bypass the Jira issue check ⭐
/bypass_peer_approval Bypass the pull request peers' approval ⭐
/bypass_leader_approval Bypass the pull request leaders' approval ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

The Fix Version/s in issue CLDSRV-1017 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.5.0

Please check the Fix Version/s of CLDSRV-1017, or the target
branch of this pull request.

multiObjectDelete.multiObjectDelete(userAuthInfo, request, log, (err, xml) => {
assert.strictEqual(err, null);
assert.strictEqual(xml.includes('<Error><Key>deny/d</Key><Code>AccessDenied</Code>'), true);
assert.strictEqual(xml.includes('<Deleted><Key>allow/d</Key></Deleted>'), true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer assert.match over assert.strictEqual(xml.includes(...), true) so a failure shows the actual XML. Same for lines 653-654.

Suggested change
assert.strictEqual(xml.includes('<Deleted><Key>allow/d</Key></Deleted>'), true);
assert.match(xml, /<Error><Key>deny\/d<\/Key><Code>AccessDenied<\/Code>/);
assert.match(xml, /<Deleted><Key>allow\/d<\/Key><\/Deleted>/);

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.67%. Comparing base (17977b1) to head (002cfa6).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/multiObjectDelete.js 90.10% <100.00%> (+6.41%) ⬆️
@@                 Coverage Diff                 @@
##           development/9.5    #6323      +/-   ##
===================================================
+ Coverage            86.55%   86.67%   +0.12%     
===================================================
  Files                  213      213              
  Lines                14612    14609       -3     
===================================================
+ Hits                 12647    12662      +15     
+ Misses                1965     1947      -18     
Flag Coverage Δ
checksums-disabled-tests 35.38% <0.00%> (+<0.01%) ⬆️
file-ft-tests 70.01% <0.00%> (+0.01%) ⬆️
file-ft-tests-null-compat 70.53% <0.00%> (-0.05%) ⬇️
kmip-ft-tests 28.16% <0.00%> (+<0.01%) ⬆️
mongo-v0-ft-tests 71.23% <0.00%> (-0.04%) ⬇️
mongo-v1-ft-tests 71.29% <0.00%> (+0.08%) ⬆️
multiple-backend 36.16% <0.00%> (+<0.01%) ⬆️
s3c-ft-tests-v0 65.04% <0.00%> (-0.01%) ⬇️
s3c-ft-tests-v0-null-compat 65.09% <0.00%> (-0.01%) ⬇️
s3c-ft-tests-v1 65.02% <0.00%> (-0.01%) ⬇️
sur-tests 37.59% <0.00%> (+<0.01%) ⬆️
sur-tests-inflights 39.55% <0.00%> (+0.03%) ⬆️
unit 74.44% <100.00%> (+0.12%) ⬆️
utapi-v2-tests 35.36% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

2 participants