Skip to content
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

Static object session with search verb allows to search all objects in container #2030

Open
abereziny opened this issue Nov 9, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers I4 No visible changes S4 Routine U4 Nothing urgent

Comments

@abereziny
Copy link

abereziny commented Nov 9, 2022

  1. Have 3 objects in container (oid1, oid2, oid3)
  2. Create static session with search verb for 2 objects in container
{
    "body": {
        "id": "GA38eKGHSxK6dCrrIcNOCA==",
        "ownerID": {
            "value": "<owner_id>"
        },
        "lifetime": {
            "exp": "100000000",
            "nbf": "0",
            "iat": "0"
        },
        "sessionKey": "<session_key_of_user_wallet>",
        "object": {
            "verb": "SEARCH",
            "target": {
                "container": {
                    "value": "<container_id>"
                },
                "objects": [
                    {
                        "value": "<oid1>"
                    },
                    {
                        "value": "<oid2>"
                    }
                ]
            }
        }
    }
}
  1. Sign token
  2. Using signed token as static session make search request

Expected Behavior

Search should return only objects allowed in static session: oid1 and oid2

Current Behavior

Search returns all objects in container: oid1, oid2, oid3

Which makes user with limited rights to scan whole container.

Autotest

in feature branch
https://github.com/abereziny/neofs-testcases/tree/feature/abereziny-add-object-static-session-tests
testsuites.session_token.test_object_session_token#test_static_session_search

@fyrchik
Copy link
Contributor

fyrchik commented Nov 11, 2022

I see no value in this restriction:

  1. SEARCH command is used to find all objects with some property. If the set of objects is known beforehand, this can trivially be done with GET.
  2. Even more than that, SEARCH will probably visit all container nodes but with GET we likely know the precise location of all objects.
  3. We usually use target field for restricting input operations, here we restrict the result, because search has no parameters.

roman-khimov added a commit to nspcc-dev/neofs-testcases that referenced this issue Mar 21, 2023
#529)

Skip the falling test and mark it as nspcc_dev__neofs_node__issue_2030.
See nspcc-dev/neofs-node#2030 for details.
@roman-khimov
Copy link
Member

Should be documented somewhere.

@roman-khimov roman-khimov added documentation Improvements or additions to documentation good first issue Good for newcomers and removed bug Something isn't working triage labels Apr 21, 2023
@roman-khimov roman-khimov added U4 Nothing urgent S4 Routine I4 No visible changes and removed U3 Regular labels Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers I4 No visible changes S4 Routine U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

5 participants