rdf4j icon indicating copy to clipboard operation
rdf4j copied to clipboard

Create/update namespace endpoint does not validate the prefix and the URI

Open nikolaykolev opened this issue 2 years ago • 0 comments

Current Behavior

I can create/update a prefix with invalid prefix and URI, there's no validation in the endpoint.

Expected Behavior

There should be a validation of the URI at least, I'm not sure about the prefix, but I guess creating a prefix with a space or < > in it should not be allowed as well.

Steps To Reproduce

  1. Execute the following: curl 'http://localhost:7222/repositories/x/namespaces/asd%20c' -X 'PUT' --data-raw 'http://xxx.com'

  2. The namespace is created successfully although the prefix has a space in it (asd c)

  3. Execute the following curl 'http://localhost:7222/repositories/x/namespaces/asd' -X 'PUT' --data-raw 'httpxxxcom'

  4. The namespace is created with URI httpxxxcom

Version

4.0.0-M2

Are you interested in contributing a solution yourself?

No response

Anything else?

No response

nikolaykolev avatar Apr 08 '22 07:04 nikolaykolev