Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concerning eval #62

Open
sunnyayyl opened this issue Dec 8, 2024 · 0 comments
Open

Concerning eval #62

sunnyayyl opened this issue Dec 8, 2024 · 0 comments

Comments

@sunnyayyl
Copy link

ce = eval("digitalio.DigitalInOut(board.D" + str(ce) + ")")

I am not very experienced in meta-programming, so apologies if I misunderstood anything. But this looks concerning.
For example, you can run an arbitrary (buildin) function:

from apa102_pi.driver import apa102
apa102.APA102(ce="0),(print('testing')")

I feel like ce should be checked with .isnumeric() beforehand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant