Role authorization passes, then the endpoint re-encrypts whatever key you send it. It never checks the key is yours, so an authorized user can re-target ciphertext they don't own.
What goes wrong
Holding a role is not the same as owning the object. This endpoint checks that the caller has an allowed role, then re-encrypts whatever encrypted key they pass in. It never binds that key to an owner or the tenant it belongs to. So a caller with the role can feed in a key that belongs to someone else and get it re-encrypted toward a target they choose.
A re-encryption primitive is a machine for changing who can read a key. Point it at material you do not control and you can move that access to yourself or a third party. The authorization here was written at the wrong layer. It gates the function, not the data. Every crypto operation that acts on caller-supplied ciphertext has to answer "is this yours" before it runs.
The pattern
@RequireRole("key-user")
function reEncrypt(encryptedKey, target):
// role check has passed
// caller-supplied ciphertext, no owner check
// no tenant or purpose binding
return crypto.reEncrypt(encryptedKey, target)@RequireRole("key-user")
function reEncrypt(keyRef, target):
key = store.load(keyRef)
if (key.owner != caller.tenant):
return FORBIDDEN
if (!policy.allowsTarget(key, target)):
return FORBIDDEN
return crypto.reEncrypt(key.ciphertext, target)Grounding and reachability were confirmed. The exploit-path gate would not conclude without the calling code, so the finding was held and an evidence request was raised instead of being reported as fact.
Why it matters to you
Multi-tenant crypto services live or die on data-level authorization. A role check tells you the caller may use the feature. It says nothing about whether this specific key is theirs. If one role spans many tenants, a single authorized account becomes a way to re-key everyone's material. Bind every operation to the owning tenant and the intended purpose, or the feature is an oracle.
Check your own code
- For every crypto endpoint, list what ties the input ciphertext to the caller.
- Replace raw ciphertext parameters with server-side references you can authorize.
- Check that ownership and tenant are verified, beyond the mere presence of a role.
- Constrain the allowed re-encryption or decryption targets by policy.