Skip to content

Report command failing in 1.9.1 #1070

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

Closed
psiotwo opened this issue Nov 2, 2022 · 7 comments
Closed

Report command failing in 1.9.1 #1070

psiotwo opened this issue Nov 2, 2022 · 7 comments

Comments

@psiotwo
Copy link
Contributor

psiotwo commented Nov 2, 2022

robot report --input-iri http://purl.obolibrary.org/obo/chebi.owl --fail-on none -o report.json fails with

The incoming YAML document exceeds the limit: 3145728 code points.

@jamesaoverton Looks like it is connected to upgrading SnakeYaml to 1.32 which introduced 3M default for codepointlimit. See changelog.

@jamesaoverton
Copy link
Member

Thanks for the report. They're now setting the codepointlimit at 3MB, which seems tiny. The simple thing to do is just increase the limit. I guess we can just get the size of the YAML string from toYAML().

We could also generate the JSON directly, instead of going through YAML.

psiotwo pushed a commit to psiotwo/robot that referenced this issue Nov 3, 2022
psiotwo pushed a commit to psiotwo/robot that referenced this issue Nov 3, 2022
@psiotwo
Copy link
Contributor Author

psiotwo commented Nov 3, 2022

Hm, so SnakeYaml seems to be used

  1. during ontology loading, and also
  2. (indirectly through jackson-dataformats-text) during toJSON serialization of a report .

The reported issues relates to 2, see an open issue at jackson-dataformats-text - the hotfix on their side was to downgrade SnakeYaml to 1.31.

As a hot fix downgrading SnakeYaml should be the easiest way to go forward. So my imminent proposal is this PR.

In longer run, I definitely vote for avoiding transformation to YAML inside toJSON.

@jamesaoverton
Copy link
Member

Hmm. I upgraded to 1.3.2 because of a Dependabot advisory: "snakeYAML before 1.31 vulnerable to Denial of Service due to Out-of-bounds Write"

@psiotwo
Copy link
Contributor Author

psiotwo commented Nov 3, 2022

😄 I see ...

Looking at IOHelper I was even unaware there is a YAML serialization of an ontology ... didn't find anything in ROBOT doc either - so if this bit of code is actually used, then the vulnerability might occur, indeed. The questions is what impact such attack actually would have here ...

Anyway, would need to revert to some previous version of robot in my pipeline until this is resolved.

@jamesaoverton
Copy link
Member

In the dawn of time, some of us played with the idea of "YAML-LD": #20 (comment). I seriously doubt that it's being used much in practice.

There is a more official YAML-LD project, I guess, https://github.com/json-ld/yaml-ld, but I don't know anything about it.

@psiotwo
Copy link
Contributor Author

psiotwo commented Nov 3, 2022

Thanks for info, interesting ...

If so, then one option also would be just to write some deprecation warning/disclaimer in the doc of YAML->JSON transformation. This might justify the downgrade and then wait until FasterXML/jackson-dataformats-text#337 is resolved.

Unless there is quick (but cleaner) way that I cannot see ...

@jamesaoverton
Copy link
Member

Still not fix fixed upstream. I'm frustrated. I'm just going to merge your PR. Thanks!

jamesaoverton added a commit that referenced this issue Nov 22, 2022
@psiotwo psiotwo closed this as completed Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants