Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1331

Should org.apache.olingo.server.api.uri.UriHelper.parseEntityId accept EntitySets without keys?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • (Java) V4 4.5.0, (Java) V4 4.6.0
    • None
    • odata4-server

    Description

      According to the JavaDoc of org.apache.olingo.server.api.uri.UriHelper.parseEntityId, this method parses Entity IDs. It is noted, that there must be a key present in the parameter entityid. However, in the implementation in UriHelperImpl that key is not required. That seems to be wrong and this might be bad for the user of the Olingo library:
      The parameter entityId is probably coming via HTTP and can thus be anything. It might even be carefully selected by some attacker.
      The current implementation just delegates parsing to the class Parser. Then it is checked how many resource parts are returned and of what type the first part is, but not whether there are any keys.

      So you could do this, e.g. in an odata.bind:
      entitysetname instead of entitysetname(23).

      Maybe that is intentionally permitted, but I don't know OData enough to be absolutely sure.
      If desirable, I could write a patch and a unit test for that.

      Attachments

        Activity

          People

            Unassigned Unassigned
            silverbanana@gmx.de Bernd Fuhrmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified