Code Monkey home page Code Monkey logo

Comments (4)

xflr6 avatar xflr6 commented on July 21, 2024

Thanks. This concerns downstream conda-forge/python-graphviz and the anaconda Graphviz package introducing the .bat wrappers (a vanilla Graphviz installation uses plain .exe binaries).

Looks like the issue is already known downstream: conda-forge/python-graphviz-feedstock#2
It might be better to fix it there. As for the implementation, it might be better to append .bat to the engine command on Windows in that package, or fall back to launch with .bat as you proposed (the patch in the pull request uses shell=True, which AFAICS may be a security risk).

from graphviz.

vidartf avatar vidartf commented on July 21, 2024

Thanks for pointing out the downstream issue, I wasn't sure where to best submit it. Regarding security risk of shell=True, that should not be an issue as the arguments are validated against a whitelist here, effectively preventing the risk of a shell code-injection.

That said, executables on Windows almost always have an extension, and Popen on Windows says extensions are significant. As such, having this package enforce extension-less engine commands seem counter-intuitive (i.e. this will be an issue on Windows irregardless of whether Graphviz was installed by Conda or not).

from graphviz.

vidartf avatar vidartf commented on July 21, 2024

Update: I read the docs again, and Popen on Windows (CreateProcess) does imply .exe if the extension is missing, so it might be acceptable to not include an extension for the engine.

from graphviz.

xflr6 avatar xflr6 commented on July 21, 2024

Yes, this machine here is actually running Windows, so I'm sure it works with vanilla Graphviz. :)

Right, the executables are whitelisted, but I imagine that a user-provided filename could be (ab)used for some kind of shell injection (but I am no security expert).

Added my proposed fix here (so this can be closed): conda-forge/python-graphviz-feedstock#6

from graphviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.