fix matching of resource ARNs whose relative-id contains a colon#2638
Open
delthas wants to merge 2 commits into
Open
fix matching of resource ARNs whose relative-id contains a colon#2638delthas wants to merge 2 commits into
delthas wants to merge 2 commits into
Conversation
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development/8.4 #2638 +/- ##
================================================
Coverage 73.92% 73.92%
================================================
Files 229 229
Lines 18480 18480
Branches 3822 3820 -2
================================================
Hits 13661 13661
Misses 4814 4814
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
de98726 to
62570e0
Compare
Formatting only, no functional change. Issue: ARSN-591
62570e0 to
625960d
Compare
SylvainSenechal
approved these changes
Jun 10, 2026
SylvainSenechal
left a comment
Contributor
There was a problem hiding this comment.
nice catch, hopefully we don't get RDs with client suddenly having issues with their policies 🌚
checkArnMatch splits the policy ARN on ':' and anchors each portion individually before re-joining the relative-id portions, so a policy ARN whose relative-id contains ':' (legal in S3 object keys, e.g. bucket/data:2024/report.csv) compiled to an unsatisfiable pattern like '^bucket/data$:^2024/\.\.\.$' and never matched any request - not even a byte-identical ARN. Allow statements on such resources silently granted nothing and Deny statements silently failed to deny. The request side already handles colons by re-joining the split portions. Wildcard-translate the joined relative-id as one unit instead, producing a single anchored pattern. Six-portion ARNs compile to byte-identical patterns (no behavior change); ARNs with fewer than six portions keep their previous behavior. Issue: ARSN-591
625960d to
53bafdc
Compare
|
LGTM |
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.
A policy
ResourceARN whose relative-id contains':'(legal in S3 object keys, e.g.bucket/data:2024/report.csv) never matched any request — not even a byte-identical ARN.checkArnMatchanchors each':'-split portion individually (^…$) and then re-joins the relative-id portions, producing an unsatisfiable pattern like^bucket/data$:^2024/….$($= end-of-input, so a required':'after it can never match). The request side already re-joins split portions correctly; only the policy side was broken.Fix: wildcard-translate the joined relative-id as one unit, yielding a single anchored pattern. Six-portion ARNs compile to byte-identical patterns — no behavior change for them (all pre-existing tests pass unchanged); ARNs with fewer than six portions keep their previous behavior.
⚠ Behavior change: policy statements on colon-containing resources that were silently dead start applying after upgrade —
Allowstatements start granting (as their authors intended) andDenystatements start denying (they previously failed open).Issue: ARSN-591