-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
Safety first, unsafe second (s/load/unsafeLoad/g;s/safeLoad/load/g) #330
Comments
That issue in pyyaml is still open, because nobody cares :) I'd say, current situation has historic reasons. I would also prefer safe defaults, but that's not enougth to fuckup API. Also, probably JS implementation needs stringify/parse methods like JSON. In short: no time for active maintenance of this project :). It's very boring to decide every design/'spec problem separately. Someone need to spend noticeable time and summarize all pending tails, related to design/spec, to move forward. |
People do care, but most of the time only after something has happened. There are so many issues and CVEs about those kinds of bad API design. Checkout the actively maintained projects ruamel.yaml and strictyaml where those issues are addressed. PyYAML seems unmaintained, thats why they did not address it I guess. Please checkout https://www.youtube.com/watch?v=kjZHjvrAS74
Can I submit a PR maybe and help with it? |
As i said, i would like to avoid major version change for only one feature. This package is stable and used wide. A lot of issues in tracker should be resolved to say "we did something new". I mean:
That does not require coding, but requires to talks with spec authors, and some thinking. PS. I have ideas how to rewrite parser with use of typed arrays for ultra fast tokens store. But have no chances to start until architecture issues clarified. |
OK, understandable, thanks for explaining. As not much "coding" is required to solve this issue, maybe it can be tagged to be included in the next major version bump? |
I can keep it open for guarantee, but all problems are known very well :). I can even create one collaborated ticket with all existing design problems, if someone decides to help with those. |
Thanks very much!
To much to maintain currently myself. Maybe I will come back to it. |
See #331. |
Solved by 1d7d7e9 |
Thanks very much for your work! As said in the README, the project started out as a port of PyYAML. The origins of js-yaml are still visible because some bad decisions in PyYAML have also made it into this rewrite. Mainly that the default
load
function is unsafe and the safe variant is calledsafeLoad
.Check the proposal in https://bitbucket.org/ruamel/yaml/issues/6/make-the-default-load-and-dump-methods is which I would also propose here. This would be a break, sure, but that is what semantic versioning is for 😉
Refer to yaml/pyyaml#5 which includes many examples and a talk why this is bad.
The text was updated successfully, but these errors were encountered: