mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #237] Architecture: Strip all Javascript from static html archives by default #3184
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#3184
Loading…
Add table
Add a link
Reference in a new issue
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?
Originally created by @noirscape on GitHub (May 9, 2019).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/237
Type
What is the problem that your feature request solves
Some websites use javascript to redirect any saved pages to the original site, thereby beaking archiving of pages on the site in question.
Describe the ideal specific solution you'd want, and whether it fits into any broader scope of changes
Ideally, the option to scan the javascript in each downloaded file to prevent setting
window.locationin any form.Since JS can be obfuscated in all sorts of forms, perphaps an option to simply strip out javascript from downloaded files could also be useful slash more reasonable to implement.
What hacks or alternative solutions have you tried to solve the problem?
Currently, the only real solution is to open up the offending HTML files myself and remove the javascript causing the redirects from the <script> tags.
How badly do you want this new feature?
@pirate commented on GitHub (May 18, 2019):
Yeah we're definitely adding this soon, it's a huge security issue currently to allow archived pages to run JS in a shared context, especially when opened via the filesystem.I've officially made this a blocker to v0.4 due to the urgency: https://github.com/pirate/ArchiveBox/pull/207#issuecomment-494107553 but I cant promise I'll get around to it soon. In the meantime I'm adding notices to the README and wikis telling people not to use it for private content and to beware of potential JS execution reading from the filesystem / XSS-ing the archive.This issue has evolved over time and can be tracked here now: https://github.com/ArchiveBox/ArchiveBox/issues/239
@pirate commented on GitHub (Jan 20, 2024):
Our new solution moving forward is likely going to involve serving untrusted JS from a different port + adding csp/cors/etc. headers, as JS sanitizing /stripping is inherently fraught with security risk and doesn't provide the best user experience.
Follow here for updates: https://github.com/ArchiveBox/ArchiveBox/issues/239