-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unauthorized container ops with sessions #2958
Conversation
Previously, IR could approve container write operations (PUT, DELETE or SETEACL) without proper authorization: the request handler did not check public key from the session token signature against the session requester, i.e. the container owner. This created a vulnerability in which any 3rd party could sign the token and perform the operation on behalf of the container owner by specifying him as the session owner. Now all container request processors assert that session token is signed by the container owner. Otherwise, requests are denied. Fixes #2947. Signed-off-by: Leonard Lyubich <[email protected]>
cc55373
to
852471c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2958 +/- ##
==========================================
- Coverage 23.52% 23.52% -0.01%
==========================================
Files 776 776
Lines 46606 46619 +13
==========================================
+ Hits 10964 10967 +3
- Misses 34778 34789 +11
+ Partials 864 863 -1 ☔ View full report in Codecov by Sentry. |
Previously, CLI `util sign session-token` command unconditionally overrode issuer field to the execution wallet. This could lead to an unexpected behavior when user explicitly specified the issuer in the token and wanted to just attach signature to it. This changes the default behavior to save the issuer field and adds `--force-issuer` flag reproducing the old behavior. Refs #2947. Refs #2487. Signed-off-by: Leonard Lyubich <[email protected]>
852471c
to
4133364
Compare
if forceIss { | ||
err = stok.Sign(user.NewAutoIDSignerRFC6979(*pk)) | ||
} else { | ||
err = stok.SetSignature(neofsecdsa.SignerRFC6979(*pk)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check already attached issuer? warn/err if does not match/missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wouldnt add one more key<->user relation. And error is bad here to me cuz this utility should help, not limit. Dont think warning will be useful too: if other issuer is a problem - user will get his error later anyway, if not - there is nothing to worry bout
CLI change is under discussion, see #2947 (comment)