Comments (6)
I'm reopening this issue because of pull request #4 (@andrew-d wrote a quick and simple alternative to my commit, but he's also not using an established library) and the comments in a12dd0c.
@kofalt @svisser, any suggestions on what library to use? Is there one that's included with python, so we won't have to include more dependencies?
Also, while important, I think this is a defense-in-depth problem. I'm skeptical if timing attacks can even work when hopping across 7 Tor nodes. The person running onionshare gets to see logs scroll by of every request made. And the attacker would have to somehow learn the specific, short-lived .onion address to attack in the first place.
from onionshare.
There's the built-in hmac.compare_digest, but that was only added in Python 3.3. It might be possible to do a fallback of sorts:
import hmac
if hasattr(hmac, 'compare_digest'):
is_equal = hmac.compare_digest
else:
# Etc.
I'm not familiar with other, external libraries.
EDIT: Also, it appears that this only supports ASCII characters, throwing a TypeError
on Unicode strings. You'd have to encode the strings first.
from onionshare.
I just implemented #2 which actually completely gets rid of basic auth and the username and password, which basically means there is no string comparison of secret data going on in onionshare.py
anymore.
But the real question is: is there still the same timing attack to guess the URL, but this time the problem is nestled somewhere in flask's routing code?
from onionshare.
But the real question is: is there still the same timing attack to guess the URL, but this time the problem is nestled somewhere in flask's routing code?
Good point. I did not dig into the code enough to definitively determine this, but it is likely those comparisons are not constant time.
I do not agree that we should just assume that timing attacks are "impossible over Tor" (famous last words). I do, however, think, that this is a good opportunity to create a threat model document, which we can use to evaluate this kind of trade-off.
from onionshare.
The route
decorator uses add_url_rule
internally, so we can subclass and change that method, perhaps substituting a constant time string comparison algo such as hmac.compare_digest
.
from onionshare.
@garrettr, nice I like it.
from onionshare.
Related Issues (20)
- repair HOT 1
- Add option for automatically sharing a website HOT 1
- Allow translating the web interfaces? HOT 4
- new tag? HOT 2
- fix flatpak syncing HOT 1
- Creating Persistent Receive Files from CLI Only HOT 3
- Flask
- test
- Allow Upload and Download using Share Mode HOT 1
- python-stem is obsolete HOT 2
- Doesn't load fonts from html file HOT 2
- Unable to generate QR Codes
- Improve flatpak go and python module generators
- Qt6 depdenency & backport to Debian stable / Tails HOT 1
- Improvements to the receive mode web frontend
- v2.6.1: onionshare depends on onionshare_cli but also conflicts with onionshare_cli
- Fix deprecated Enums in new PySide6 versions
- Move description to long_description in setup.py
- Make Japanese as available language on documentation HOT 1
- Flatpak version: "No module named 'PySide2" HOT 8
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 onionshare.