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

CVE - Remote code execution in test suite. #318

Closed
BillSchumacher opened this issue Jul 9, 2022 · 17 comments
Closed

CVE - Remote code execution in test suite. #318

BillSchumacher opened this issue Jul 9, 2022 · 17 comments

Comments

@BillSchumacher
Copy link

Please read the bug submission guidelines before submitting a bug.

Not following guidelines may result in your bug being ignored and/or closed.

Description of Bug
Remote code execution is possible via rouge commit or hidden logic.

Code to Reproduce
See PR.

IMPORTANT: Remember to anonymize your code. Be sure to replace API keys/Client IDs with placeholders. Also, never, ever share the contents of your token file.

Expected Behavior
Code does not execute arbitrarily on my system.

Actual Behavior
Code executes arbitrarily when running test suite.

Error/Exception Log, If Applicable
See here to learn how to turn on debug logging: https://tda-api.readthedocs.io/en/latest/help.html

@BillSchumacher
Copy link
Author

The implementation of this is very dangerous and highly suspect.

@alexgolec
Copy link
Owner

alexgolec commented Jul 9, 2022

So let me get this straight: you're executing code arbitrarily on my system by… editing the library? This is not exactly CVE material.

Don’t get me wrong, I get the principle of what you’re trying to argue. The library is in fact generating text that happens to represent code, and you have found a way to manipulate that text. But generating text does not constitute a security vulnerability.

@BillSchumacher
Copy link
Author

By passing a value to a function, I could have done this a number of ways as could have you.

@BillSchumacher
Copy link
Author

If you want to see a sneakier example I can put that together too.

@BillSchumacher
Copy link
Author

You asked me to show you where this was ever executed by the library, there it is.

@BillSchumacher
Copy link
Author

I'm not saying you're a bad person, but I will say it would be very easy for you to sneak in nefarious logic.

@alexgolec
Copy link
Owner

alexgolec commented Jul 9, 2022

While I think you have pointed out something good, which is that there is an opportunity here to replace this exec statement with a compiler attempt, I have to admit your demeanor and rudeness make me less than eager to continue working with you.

If you want to redeem yourself by making yourself useful, feel free to send me a PR that replaces this exec call with a call to the following:

https://stackoverflow.com/questions/37012947/how-to-tell-if-a-single-line-of-python-is-syntactically-valid

@BillSchumacher
Copy link
Author

Your lax attitude about security makes me not want to work with you either, I was simply protecting someone that may not know what this code was capable of.

@BillSchumacher
Copy link
Author

BillSchumacher commented Jul 9, 2022

Consider the people that use your library and their users, the most probable victims, over my rudeness.

@alexgolec
Copy link
Owner

Update: running exec in the test suite is in fact correct behavior because the test needs to verify that the generated object is equal to the one that was passed in. Working as intended, no CVE granted.

@BillSchumacher
Copy link
Author

Lol, sir... let's talk about pickle then.

@BillSchumacher
Copy link
Author

You unfortunately don't get to decide what is a risk and what is not. exec is almost never the correct answer.

@BillSchumacher
Copy link
Author

A warning at a minimum about the security risks of using pickle should be posted.

@BillSchumacher
Copy link
Author

This kind of response to something that would ultimately affect me directly by running tests on your code base is unacceptable. Considering the amount of money involved.

@r4m0n
Copy link

r4m0n commented Jul 12, 2022

This is not a chat room, please stop spamming people following this library.

@BillSchumacher
Copy link
Author

Ah, well I tried here. Good luck folks.

@alexgolec
Copy link
Owner

+1 to @r4m0n. Please note that if the next interaction you have with this library or its community is not constructive, I will block you from interacting with us.

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

3 participants