-
Notifications
You must be signed in to change notification settings - Fork 23
JSON-LD Context similarity to XML External Entity attack #421
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
Comments
Also posted here: json-ld/json-ld.org#825 |
What is the request here? Did you want more spec text about this sort of issue? Or some sort of test coverage? If so, can you open a PR with a suggestion? Practically speaking, it may be difficult to construct a real attack with |
I was just thinking about this while implementing support for JSON-LD 1.1 in RDF4J. I know it's an issue when processing XML files and that the recommendation is to disable XXE altogether. The only way I know that the XXE attack can be used to disclose confidential data is where the contents of the data are included in an error message. I would assume that the same would be the case for (some) JSON-LD parsers. For RDF4J I was considering disabling fetching of remote/local contexts and imports as the default behaviour, but I would assume that would not make us compliant with the specification. |
This may relate to #108. Most of the issues considered about remote context access relate to the need to reduce network bandwidth and to be able to verify that the result conforms to expectations. The availability of a document loader mitigates the danger of accessing inappropriate resources or potentially getting back injected results, and is important in some contexts. |
I've been pointed towards the DocumentLoader interface as the place to implement the security controls. |
@davidlehn I've been talking to Havard. Initially I was complacent and said "this would be the fault of the JSONLD processor", "that would be the fault of a sysadmin" etc. @gkellogg I guess the issue is to come up with some best practices (good options and defaults) to be used by a security-conscious documentLoader, and if such arise, to add wording to the spec to point to them. When I'm home, I'll cite the relevant sections from the Syntax and API specs. |
JSON-LD supports referencing a context stored online or on the local file system. This seems to allow for the same attack surface as with XML External Entity.
See: https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing
The text was updated successfully, but these errors were encountered: