mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #1662] Feature Request: add unique cookie prefix or allow setting #994
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#994
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 @gen-angry on GitHub (Feb 22, 2025).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1662
Originally assigned to: @pirate on GitHub.
What type of suggestion are you making?
Modification of existing behavior
What is the problem that your feature request solves?
I am running this along with a few dozen other containers on a small home server with podman under one IP (using different port numbers for each service). It works pretty well aside from one issue: session cookie names often conflict causing frequent log outs.
archivebox uses generic names "sessionid" and "csrftoken".
What is your proposed solution?
Would it be possible to append a unique prefix to the session ID cookie name (ie: 'archivebox_sessionid') or allow us to add a prefix using an environment variable?
What hacks or alternative solutions have you tried to solve the problem?
Searched around documentation trying to find a way to set a prefix for the session cookies and could not find anything. Nor could I find any suggestions pertaining to this issue.
Share the entire output of the
archivebox versioncommand for the current verison you are using.How badly do you want this new feature?
Mini Survey
@pirate commented on GitHub (Feb 22, 2025):
Interesting. I thought different ports were considered different origins, very surprised your browser is re-using cookies across ports.
If archivebox is sharing cookies with other things on the same server that is VERY BAD. It means archived JS potentially has access to any other service you're hosting. All it would take is archiving one malicious page, then you viewing the wget output would allow an attacker to login as you on those other services and hack your accounts.
@pirate commented on GitHub (Feb 22, 2025):
Yes I just confirmed all ArchiveBox cookies are set in
HostOnlymode which means they are not exposed to any otherhost:portcombinations other than the exact one they were set with.This means your other services are the ones setting cookies without
HostOnly, which is a potential security risk that those services should fix. If we changed our cookies names it would fix the glitches you're seeing but it would hide the real security issue more, so I'm on the fence about it. In general ArchiveBox is not really safe to host on a shared domain with anything else because it contains a ton of untrusted HTML, JS, CSS, cookies, etc., so I strongly discourage it, you should really set up ingress on a unique domain specific to archivebox using something like traefik or cloudflare tunnels.@gen-angry commented on GitHub (Feb 22, 2025):
That's still checked for me for every cookie (archivebox and others) for the address. I thought it would cover the port?
That said - it's a good point about hosting on a shared deal. The web panel isn't exposed to the internet anyways and I only use it to archive select reddit comments. However, I still can't account for unsafe code as you pointed out so I'll move it to it's own IP and instance sometime today anyways as a precaution.
edit: I found this which may be relevant https://stackoverflow.com/questions/1612177/are-http-cookies-port-specific
In my case, I'll just move archivebox to it's own IP on my network. But I would still like to make this request as I feel it would aid in security even if it's a small way.