f-string support in taint analysis
Tweaking the example code in https://pyre-check.org/docs/static-analysis.html:
If inside get_image, we use an f-string rather than .format()
- command = "wget -q https:{}".format(url)
+ command = f"wget -q https:{url}"
Pyre doesn't seem to recognize the f-string as tainted: the output of the taint analysis is empty. Is this expected, and additional config required to the taint analysis to support f-strings?
Sounds like a bug in that is should be supported. Could you send a full repro?
@fahndrich apologies--I went to reproduce and realized I was testing with 0.0.29, not the 0.0.30 release. 0.0.30 models the f-strings just fine in the example.
However I did discover that the taint models in the tutorial are wrong for 0.0.30:
Taint__Model.InvalidModel("Invalid model for `input` defined in `.../stubs/taint/general.pysa:3`)
Changing the model for input to the following worked for me:
def input(__prompt = ...) -> TaintSource[UserSpecified]: ...