fix: [plausible, clickhouse] close the /storybook code execution (Plausible 3.2.1) and apply ClickHouse low-memory settings #2

Merged
stephansainleger merged 2 commits from vlab/plausible-storybook-rce AGit into master 2026-11-05 08:25:41 +00:00

2 Commits

Author SHA1 Message Date
Valentin Lab
8f73a16f5c fix: [plausible] close the unauthenticated code execution of `/storybook with 3.2.1`
Plausible Community Edition up to ``3.2.0`` serves ``/storybook``, which
compiles and runs code sent by any visitor (CVE-2026-8467,
GHSA-mhcv-h7gf-57cf).  It was used to install cryptocurrency miners in
the container of a ``3.0.1`` deployment.  ``3.2.1`` removes the endpoint.

- Use ``docker.0k.io/plausible:3.2.1`` (from
  ``ghcr.io/plausible/community-edition:v3.2.1``).  The database
  migrations run at start as before; ``3.0.1`` data migrates without
  manual step.
- The default web-proxy rules refuse ``/storybook``, in case an older
  image is ever deployed again.
- The Erlang release cookie of the image is created when the image is
  built, so it is the same on every installation.  The ``init`` hook now
  generates one per installation (``release-cookie``) and sets
  ``RELEASE_DISTRIBUTION`` to ``none``: this single node opens no
  ``epmd`` nor distribution port.

Assisted-by: Claude:claude-opus-5-5
2026-10-27 11:23:21 +01:00
Valentin Lab
7ffadbf2ff fix: [clickhouse] apply the low-memory settings that ClickHouse was ignoring
The ``max_threads``, ``max_block_size``, ``max_download_threads`` and
parallel parsing and formatting settings were declared in a
``<profile>`` block of ``config.d/low-resources.xml``.  ClickHouse only
reads profile settings from users configuration files, so they were
silently ignored and the server used its defaults (one thread per core,
larger blocks).

Following the Plausible Community Edition change of ``v3.2.0`` (its
pull request 265), ``config.d/low-resources.xml`` now keeps only the
server setting ``mark_cache_size``, and the profile settings move to
``users.d/default-profile-low-resources-overrides.xml``, inside
``<profiles>``.  ``system.settings`` now reports ``max_threads`` 1.

Assisted-by: Claude:claude-opus-5-5
2026-10-27 11:23:21 +01:00