Giter VIP home page Giter VIP logo

Comments (6)

newville avatar newville commented on May 31, 2024 2

@snoopysecurity thanks for the reminder - I just tagged 0.9.23 and pushed to PyPI.

from asteval.

newville avatar newville commented on May 31, 2024

@ross-bradley Thanks! Yes, you are completely correct and this should be addressed.

I think the best approach here is to simply (and always) disallow access to "dunder" attributes entirely but to also keep the other UNSAFE_ATTRS that are not "dunder" methods. A quick check shows that doing that still passes all existing tests. Doing that "no dunder methods" is still sort of a black-list instead of a white-list, but it will adapt better with newly added features.

Does that seem reasonable to you?

from asteval.

ross-bradley avatar ross-bradley commented on May 31, 2024

That seems to strike an appropriate balance. Whilst yes, it's an extension of the deny-listing approach, it seems to cover the most dangerous attributes and methods in a sufficiently sweeping manner, and does so without requiring an overly onerous effort.

from asteval.

newville avatar newville commented on May 31, 2024

@ross-bradley Thanks - I'll commit that. It turns out that 0.9.22 got released yesterday, but I'll try to push this out as 0.9.23 soon, updating the docs on what is not allowed.

FWIW, I think a whitelist of allowed attributes would be hard to maintain. I guess it does have the advantage of starting with "secure" and moving toward "useful".

from asteval.

newville avatar newville commented on May 31, 2024

@ross-bradley the fix for this is now merged into the master branch.

from asteval.

snoopysecurity avatar snoopysecurity commented on May 31, 2024

Hey @newville is it possible to publish a new release with this change? thanks

from asteval.

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.