replace google chart in wui with d3.js: it leaks information #1942
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1942
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The timing chart on the mutable file upload status page is rendered by http://chart.apis.google.com.
This reveals the IDs and latencies of storage servers to Google, as well as anyone able to observe the network between Google and the web browser.
I think this is generally undesirable, but it is particularly problematic for users of grids hosted on i2p or Tor hidden services.
It is possible (if not likely) that anonymity-desiring users are running tahoe under an LD-preload tool (such as torsocks/usewithtor) but are connecting to their WUI using a non-torified browser because they expect it to only connect to localhost. When they browse to the mutable file upload status page containing this chart, they'll inadvertently reveal themselves to be a user of the grid.
Warner suggested in email that this chart should instead be rendered locally with d3.js, which is already being used for the download timeline.
The code which constructs the google chart URL is in src/allmydata/web/status.py and might also be used on pages besides the mapupdate page where I noticed it.
Further, the very fact that anything is downloaded from any third-party server is a serious privacy bug.
+1. It also potentially gives Google access to other pages (that are related in the browsing history) of the gateway's local origin.
We should put a note in source:docs/known_issues.rst for 1.10, and switch to using
d3.js
for 1.11.There don't appear to be any other uses of Google Charts other than the mutable servermap update status page.
Adding to 1.10 to remind me to update
known_issues.rst
. Will retarget to 1.11 after that to cover thed3.js
rewrite.BTW I was careful to only have this chart on a page whose URL has no secrets (it just has the storage index, which is also exposed to storage servers), but I agree that a JS-enabled browser or a non-Tor-ified browser would experience a privacy/access problem. Oops.
Oh, wait, I remember thinking about this. No, the chart that is loaded is an IMG tag (and google generally returns a PNG). Everything Leif said is correct, but it does not give google access to the rest of the origin (if it were including JS or CSS or something active, it would, but a plain IMG tag won't load anything active). I briefly had code to generate a PNG in the tahoe client itself, but that added a dependency on the PIL library which seemed a bit big.
I think d3.js is the right way to go: it doesn't make the python-side code any bigger, the JS library is already in our tree, and I'm ok with not giving timelines to folks who have JS turned off.
It used to be possible to same-origin-attack a browser using JavaScript in an SVG file loaded by an
img
tag (http://www.librador.com/2011/03/09/Dangers-of-SVG-and-the-img-tag/), but apparently recent browsers do not load JavaScript in that case (http://stackoverflow.com/questions/7917008/xss-when-loading-untrusted-svg-using-img-tag).In changeset:3a18157456951841:
Ok, that patch updates known_issues.rst . We can now turn this ticket into "replace the timing chart with local d3.js".
BTW, the leak was even smaller than I thought: the referrer URL only contains the count of mapupdate operations (basically any mutable-file read or write) since last node boot. It doesn't even include the storage-index of the file.
google chart in wui leaks informationto replace google chart in wui with d3.js: it leaks informationReviewed the known_issues text, +1.
Replying to Brian Warner <warner@…>:
I think instead of "reveal your use of Tahoe to the outside world" it would be better to say "reveal your use of that grid to the outside world", since the chart URL contains storage server IDs.
In changeset:02975d188735a59f:
Attachment 1942-wui-replace-google-chart-with-d3js-initial.patch (2834 bytes) added
Starting to work on it... see https://tahoe-lafs.org/trac/tahoe-lafs/attachment/ticket/1942/1942-wui-replace-google-chart-with-d3js-initial.patch
Added the needed JS libraries to source:src/allmydata/web/map-update-status.xhtml and a
div
id like in source:src/allmydata/web/download-status-timeline.xhtml.The code to create in source:src/allmydata/web/static/update_status_timing_chart.js might be similar to the one that is in source:src/allmydata/web/static/download_status_timeline.js.
The functions to change in source:src/allmydata/web/status.py seems to be
MapupdateStatusPage.render_timing_chart
andMapupdateStatusPage._timing_chart
.Is the code in
DownloadStatusPage.child_event_json
(source:src/allmydata/web/status.py) creating the data that source:src/allmydata/web/static/download_status_timeline.js is using?I'm provisionally moving this into the 1.12 milestone, in case we want to make a push for #1010
anonymous = true
, which I think would depend upon making this fix.If so, I think it'd be acceptable to change the WUI to not serve that IMG tag when we're in anonymous mode. That'd be a bit quicker of a fix than properly re-implementing the chart.
We might not treat 1.12 as the "client-side Tor enabled" release, in which case we can push this out a bit further.
Note that if you're using a non-Tor-ified browser to view files coming out of your Tahoe client, then those files could use their own image tags to leak your IP address. Not a reason to not fix this, but something to remain aware of.
Note that Google deprecated the charts API in 2012, so this feature is lucky to still be working anyways.
I'm going to delete the chart now (the time axis of the chart is pretty hard to read anyways), and then repurpose this ticket to be about adding a new chart (rendered locally with d3.js).
Attachment servermap-chart.png (64473 bytes) added
sample chart as rendered by (old) Google charts API
In ed91398/trunk:
Moving this out of 1.12, now that it's not a privacy threat.
Since the offending functionality was removed years ago, I'm closing this ticket.
If someone wants to re-add this functionality, I think they should re-add it to a brand new Web UI that is packaged separately from the core Tahoe-LAFS software and uses only public, documented network APIs to retrieve the necessary information.