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

I2PControl tokens are insecure and not validated #2138

Open
eliaseinarsson opened this issue Dec 16, 2024 · 3 comments
Open

I2PControl tokens are insecure and not validated #2138

eliaseinarsson opened this issue Dec 16, 2024 · 3 comments

Comments

@eliaseinarsson
Copy link

While writing some code that communicates with the I2PControl JSON-RPC API I noticed that the Token returned by the Authenticate API was just a Unix timestamp (generated here.) This is obviously completely insufficient for an authentication token, as it is trivial to guess. A simple fix for this would be to just replace that with a call to a cryptographically secure RNG.

Much more seriously however, I also noticed that the token is not checked or validated anywhere! You can set arbitrary configuration parameters without knowing the password or having to guess the token!

@r4sas
Copy link
Member

r4sas commented Dec 19, 2024

We know about it, but nobody actually uses I2PControl, and it can't be used to control i2pd itself, so nobody did anything about it.

@r4sas
Copy link
Member

r4sas commented Dec 19, 2024

But if someone wants to fix this, please send a PR.

@eliaseinarsson
Copy link
Author

Sadly I'm not confident enough in my C++ abilities to finish the token implementation. I could probably make a PR that at least refuses to start I2PControl if a password is set and instead logs an error message, and add a note in the docs about password auth not being implemented. That way there's no chance for someone to think their I2PControl is password protected when it isn't, so they won't accidentally leave it fully accessible to the public internet like I almost did 😅

Does that sound like an acceptable stop-gap solution?

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

No branches or pull requests

2 participants