-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Ruby: JSON flow summaries #11136
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
Ruby: JSON flow summaries #11136
Conversation
97dcfdc
to
fc85996
Compare
fc85996
to
a56696f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few instance methods for oj
that look relevant for flow from the self
arg to the return value, e.g. as_json
, to_json
etc: https://rubydoc.info/gems/oj/JSON/GenericObject Are these in scope for this PR - I recognize that there's probably a ton of potential methods to model that might not be used much in practice.
row = | ||
[ | ||
"json;;Member[JSON].Method[parse,parse!,load,restore];Argument[0];ReturnValue;taint", | ||
"json;;Member[JSON].Method[generate,fast_generate,dump,unparse,fast_unparse];Argument[0];ReturnValue;taint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"json;;Member[JSON].Method[generate,fast_generate,dump,unparse,fast_unparse];Argument[0];ReturnValue;taint", | |
"json;;Member[JSON].Method[generate,fast_generate,pretty_generate,dump,unparse,fast_unparse];Argument[0];ReturnValue;taint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 added
That's a good question. As you say, there's a lot of potential methods we should model. My preference is to tackle the obvious low-hanging fruit here, and then tackle the various JSON gems in full later on, as part of general non-rails library modelling. What do you think? |
Sounds like a good approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests need updating, but otherwise LGTM - I'll reapprove when the tests are fixed.
This import isn't needed.
b862c7b
to
dab7970
Compare
Add flow summaries for
ActiveSupport::JSON
and various JSON methods. We consider JSON parsing and generation to be taint-preserving.