fix: [plausible, clickhouse] close the /storybook code execution (Plausible 3.2.1) and apply ClickHouse low-memory settings #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "vlab/plausible-storybook-rce"
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?
Why
Plausible Community Edition up to 3.2.0 serves
/storybook, which compiles and runs code sent by any visitor, without authentication (CVE-2026-8467, GHSA-mhcv-h7gf-57cf). A deployment of this charm (3.0.1) was compromised through it: cryptocurrency miners ran in the Plausible container from mid-September. 3.2.1 removes the endpoint.Changes
plausible
docker.0k.io/plausible:3.2.1(cached fromghcr.io/plausible/community-edition:v3.2.1, already pushed)./storybook(Apache returns 403), in case an older image is deployed again.inithook now generates one per installation (release-cookiein the service datastore) and setsRELEASE_DISTRIBUTION=none: this single-node install opens noepmd/ distribution port (migrations useeval, which does not need it).clickhouse
max_threads1, …) lived in a<profile>block ofconfig.d/low-resources.xml, where ClickHouse ignores them. As upstream did in CE v3.2.0 (plausible/community-edition#265), they move tousers.d/default-profile-low-resources-overrides.xml;config.d/low-resources.xmlkeeps onlymark_cache_size.Migration 3.0.1 → 3.2.1
db migrate(already in the entrypoint) applies everything at start: PostgreSQL migrations up to20251211110619, including a backfill oftracker_script_configuration(one row per site). The only new ClickHouse migration is Enterprise-only.secret-keysigns everybody out, invalidates API keys, and makes 2FA secrets unreadable unlessTOTP_VAULT_KEYis pinned to the previously derived key.Tests
Replayed on a test VPS with a copy of the compromised instance's data (6 users, 5 sites, ~194k events), deleted afterwards:
compose up, with Apache + Let's Encrypt.Checked:
/storybook: 404 from the application, 403 from Apache;/live/websocketupgrade: 101;top-statsreturns the same numbers;/api/event: 202, recorded inevents_v2;system.settings:max_threads1,max_block_size8192 … allchanged=1;RELEASE_DISTRIBUTION=none.Not in this PR
defaultuser has no password (as in upstream's own setup). It is not reachable from outside the docker network; worth hardening separately.clickhousecharm has nobackuprelation: statistics are not backed up./storybookwith3.2.1` 8f73a16f5c