Repository navigation
Conversation
Psalm's taint analysis can only follow untrusted data through this library if its docblocks say which parameters are sinks and which return values are sources. These annotations are docblock-only and have no effect at runtime.
|
Hi @danog, This sounds useful. There are other sources and sinks, for example Does Psalm consider objects other than files? |
|
Thanks! Psalm's taint analysis follows untrusted values (request parameters, uploaded data, …) into places where they could be injected: file paths, shell commands, SQL, HTML, URLs requested, and so on. A sink there is a parameter whose value is interpreted as one of those.
There were a few more methods taking a path that I'd missed, though, so I've added file sinks to The generated loaders and savers ( |
|
Unless you'd be okay with adding a custom taint type for image decoding, but I feel that's a bit overkill |
Adds Psalm taint analysis annotations, so that Psalm follows untrusted data through php-vips in the projects that use it:
Image::newFromFile()reads andImage::writeToFile()writes are file sinks.These are docblock-only changes, with no effect at runtime or on other tools. Psalm currently ships them as a stub for this library (vimeo/psalm#12466); having them here keeps them in step with the code.