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

Error when linting YAML spec with aliases #390

Open
mburtless opened this issue Jan 29, 2020 · 1 comment
Open

Error when linting YAML spec with aliases #390

mburtless opened this issue Jan 29, 2020 · 1 comment

Comments

@mburtless
Copy link

mburtless commented Jan 29, 2020

Detailed description

When running speccy lint [my-spec].yaml on a spec that contains many YAML aliases speccy will fail with the following error:

Could not read YAML/JSON from file: Excessive alias count indicates a resource exhaustion attack

Context

Our unresolved spec contains numerous refs and internal refs which must be resolved before the spec can be used for code gen.

Running speccy resolve --internal-refs [my-spec].yaml generates a fully resolved spec that makes extensive use of YAML anchors and aliases. However, this spec cannot subsequently not be linted by speccy due to this error.

Possible implementation

Judging from a similar issue with Mermade this is likely due to the maxAliasCount setting in YAML.parse() options. Mermade ended up adding a configuration option to control this setting, which seems like the most straight forward implementation for speccy as well

Your environment

  • Recreated within speccy:latest docker container
@JohanZackrisson
Copy link

Also ran into this problem and created a fix for it in #443

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