Comments (3)
also this trick can be used to construct a list that contains itself:
>>> [x for x in ([None],) for x[0] in (x,)]
[[[...]]]
repr()
is smart enough to handle the infinite-ness, but it can probably still be used to crash something:
>>> [x for x in ([None],) for x[0] in (x,)] == [x for x in ([None],) for x[0] in (x,)]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RecursionError: maximum recursion depth exceeded in comparison
from simpleeval.
That's... fun - definitely something to handle better than that!
I'm not tooooo worried about it, it's a bug, in that it throws a non-SimpleEval exception, but I don't believe there are any security implications.
Although, it would be good to add to the documentation that users should probably wrap any public facing usage of SimpleEval in a try:catch
and log errors themselves...?
from simpleeval.
Hah, wow, that's an old one! I haven't done Python in a couple years so thanks for the reminder, this was a fun hack. I'm not sure if exploitability is a big worry here... i guess this circularity construction could maaaaaaybe be used as a DoS vector somehow. But i don't currently have ideas for how that'd work.
from simpleeval.
Related Issues (20)
- Setuptools 58 breaks install HOT 1
- Possible to return function object rather than evaluate? HOT 2
- Possible to generate RPN from AST. HOT 1
- Low performance HOT 9
- We need to revisit performance limits
- We should switch to explicitly giving permission for methods / data access HOT 2
- while shortcode seems endless loop HOT 1
- Add a timeout for statements
- intercept evaluation of simpleeval and add if conditions
- MAX_STRING_LENGTH used on objects which do not increase size, creating false positives
- Allow to-bytes conversion? HOT 1
- Support implied multiply HOT 2
- Release plan HOT 6
- Possible to define my own operators HOT 1
- Problem when building using simpleeval HOT 4
- Operator with arguments?? HOT 1
- Failing install with latest setuptools (fails due to `use_2to3` no longer supported) HOT 19
- simpleeval raises NameNotDefined exception when KeyError exception occured using callable names resolver HOT 4
- Any plans for a new release? HOT 1
- how do i set limits HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpleeval.