Skip to content
Misconfiguration Disclosed report Beginner

constant cache_page_secret in regolith

The installation template ships a hard-coded, publicly known cache page secret shared by every deployment. Anyone who knows that value can craft requests that bypass the page cache, making denial-of-service attacks against the origin more effective.

e3amn2l Follow

Originally disclosed on HackerOne

Bounty$25 View original
  • Triaged in 14 hours
  • Fixed in 2 days
  • Paid in 28 hours
  • Disclosed after 32 days

in: https://github.com/iandunn/regolith/blob/master/config/plugins/wp-super-cache.php#L28

$cache_page_secret             = 'ad270361c39c428c9465313363b02559';

there usage of static $cache_page_secret, as regolith is installation template. it's better to generate the secret for each installation instead of using static known value. knowledge of $cache_page_secret value can be used to send requests which will not pass though the caching: https://github.com/Automattic/wp-super-cache/blob/ea592c1d2796d0bc5c343322923c5f8bb40a0066/wp-cache-phase1.php#L32 thus enable more effective DOS (denial of service) attacks as the caching mechanism is disabled.

fix: generate the $cache_page_secret in safe way once per installation & store the value in needed configuration file.

The original report as published on HackerOne, by e3amn2l. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is Regolith, an installation template by Ian Dunn that ships a configuration file for the WP Super Cache plugin. The researcher, e3amn2l, looked at the template's plugin configuration and found a hard-coded value for $cache_page_secret in config/plugins/wp-super-cache.php at line 28:

PHP
$cache_page_secret             = '[redacted]';

Because Regolith is a template used to build installations, every deployment that keeps this file shares the same secret. The researcher's point is that the value should be generated per installation rather than shipped as a static, publicly known constant.

The report then links to the WP Super Cache phase 1 code, where the secret is consumed:

Text
https://github.com/Automattic/wp-super-cache/blob/[redacted]/wp-cache-phase1.php#L32

Knowing $cache_page_secret lets an attacker send requests that bypass the page cache. With caching disabled for those requests, each one is served by the full WordPress stack, which the researcher says makes denial of service attacks more effective.

The suggested fix is to generate $cache_page_secret in a safe way once per installation and store the generated value in the configuration file that needs it.

The report records a bounty of 25.00 USD. It does not give a severity rating, a CVSS score, a weakness classification or a named asset, and it does not describe a live request or a measured denial of service.

Root cause

The likely root cause is that a per-installation secret was treated as a fixed configuration constant inside a reusable template. A cache-bypass secret only provides value if it is unpredictable; publishing one value in a public repository and reusing it across every installation removes that property. Anyone who reads the template knows the secret for every site built from it.

Impact

The report's impact claim is narrow: knowledge of the secret allows requests that do not pass through the caching layer, and this enables more effective denial of service attacks because the caching mechanism is disabled for those requests. The report does not claim data exposure, authentication bypass or cache poisoning. The practical effect is that requests can be sent which do not pass through the caching layer.

How this kind of bug works

Page caches sit in front of the application and serve stored responses for anonymous visitors. To let operators and plugins reach the dynamic application anyway, many cache implementations accept a bypass signal: a cookie, a query parameter, a header or a path that tells the cache to skip itself. That signal has to be authenticated in some way, otherwise anyone could bypass the cache. A common design is a shared secret that the client presents, and the cache compares it against a configured value.

The weakness appears when that secret is weak, predictable, shared across deployments, or leaked. A secret committed to a public repository is effectively public. A secret reused across all installations of a template is public for every one of them once a single copy is disclosed. With the secret known, the bypass signal can be forged, and the cache stops being a shield.

This matters most for availability. Cached responses are cheap; uncached ones consume CPU, database connections and memory. An attacker who can reliably skip the cache turns a modest request rate into a much heavier load. Defences are straightforward: generate a high-entropy secret per installation at setup time, keep it out of version control, never ship a default value that works, and rotate it if it is exposed. Where the platform allows it, restrict bypass to authenticated administrative traffic rather than a static shared string.

How to test for it

  1. Identify the caching layer in use, from response headers, cookies or known plugin paths.
  2. Look for a bypass mechanism: a cookie name, query parameter or header that appears in the cache plugin's source or documentation.
  3. Search public repositories and template projects for the configuration file that sets the corresponding secret. Installation templates, Docker images, boilerplate repos and example configs are the usual places.
  4. If a candidate secret is found, compare it with the target's behaviour: send a request with the bypass signal and the candidate value, and a matching request without it. A positive result is a response that is clearly generated dynamically (for example, a cache-miss header, a differing Age, or content that changes per request) while the normal request is served from cache.
  5. Confirm the difference is caused by the secret and not by another variable, such as a logged-in session or a different URL.

Common false positives: the site may not use the cache plugin at all; the secret may have been changed after deployment; the bypass may additionally require an authenticated session; or the observed difference may come from cache expiry rather than the bypass. Always repeat the comparison and control for timing.

How it is fixed

The standard fix is to generate the secret per installation with a cryptographically secure random source at setup, store it only in the local configuration, and exclude that configuration from version control. Templates should ship a placeholder or a generation step, never a working default. If a secret has already been published, it should be treated as compromised and rotated on affected installations.

Hunting notes

This class of issue hides in reusable artefacts: installation templates, starter themes, container images, infrastructure-as-code examples and sample configuration files. Recon signals include public repositories that reference a cache plugin's configuration keys, documentation that shows a bypass cookie or parameter, and deployments whose behaviour matches a template's defaults.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Regolith is an installation template by Ian Dunn: a starting kit that people copy to build their own WordPress sites. It comes with configuration files for the plugins it uses, and one of those files configures WP Super Cache, a plugin that stores copies of pages so the server does not have to build them again for every visitor.

The researcher, e3amn2l, opened the template's plugin configuration and found a value written directly into the file, at line 28 of config/plugins/wp-super-cache.php:

PHP
$cache_page_secret             = '[redacted]';

This is a secret string, a password-like value used by the caching plugin. Because it is typed into a file that is published on GitHub, anyone can read it. And because Regolith is a template, every site built from it that keeps this file ends up with the same secret.

The researcher's point is simple: the value should be generated fresh for each installation instead of being shipped as a fixed, publicly known constant.

The report then points to the part of WP Super Cache that reads the secret:

Text
https://github.com/Automattic/wp-super-cache/blob/[redacted]/wp-cache-phase1.php#L32

Knowing the secret lets an attacker send requests that do not pass through the cache. Each such request is handled by the full WordPress application instead of being answered from a stored copy, and the researcher says this makes denial of service attacks more effective, because the caching mechanism is switched off for those requests.

The suggested fix is to generate $cache_page_secret in a safe way once per installation and store the generated value in the configuration file that needs it.

The report records a bounty of 25.00 USD. It does not give a severity rating, a CVSS score, a weakness classification or a named asset, and it does not show a live request or a measured denial of service.

Why the value was a problem

The root cause is that a secret meant to be unique per site was treated as a fixed setting inside a reusable template. A secret only protects something if other people cannot guess it. Publishing one value in a public repository, and reusing it on every installation, removes that property: anyone who reads the template knows the secret for every site built from it.

What an attacker could do with it

The report's impact claim is: Knowledge of the secret allows requests that skip the caching layer, and this enables more effective denial of service attacks because the cache is disabled for those requests. The report does not claim data exposure, login bypass or cache poisoning. In practice, an attacker can send requests that do not pass through the cache.

In general, how this kind of bug works

A page cache is like a photocopy of a page kept at the front desk. When a visitor asks for the page, the desk hands over the copy instead of sending someone to the back office to write the page again. That is fast and cheap.

Sometimes the people running the site need to see the real, freshly built page, for example while testing changes. So cache plugins offer a way to say "skip the copy, go to the back office". That signal can be a cookie (a small piece of data the browser sends with every request), a value in the URL, or a special header (extra information attached to a request). Because anyone could send such a signal, it has to be protected: usually the client must also present a secret, and the cache compares it with the value stored in its configuration.

The weakness appears when that secret is weak, guessable, shared across many sites, or leaked. A secret committed to a public repository is effectively public. A secret reused across every installation of a template is public for all of them once one copy is disclosed. With the secret known, the skip signal can be forged, and the cache stops acting as a shield.

This matters most for availability, meaning whether the site keeps responding at all. Cached responses are cheap; uncached ones use processor time, database connections and memory. An attacker who can reliably skip the cache turns a modest number of requests into a much heavier load. The defences are straightforward: generate a long random secret per installation during setup, keep it out of version control, never ship a default value that actually works, and replace it if it is exposed. Where possible, allow cache skipping only for logged-in administrators rather than for anyone holding a shared string.

In general, how to test for it

  1. Work out which caching layer the site uses, from response headers, cookies or well-known plugin paths.
  2. Look for a bypass mechanism: a cookie name, URL parameter or header that appears in the cache plugin's source code or documentation.
  3. Search public repositories and template projects for the configuration file that sets the matching secret. Installation templates, Docker images, starter repositories and example configs are the usual places.
  4. If you find a candidate secret, compare behaviour: send one request with the bypass signal and the candidate value, and a matching request without it. A positive result is a response that is clearly built fresh (for example a cache-miss header, a different Age value, or content that changes on each request) while the normal request is served from the cache.
  5. Confirm the difference comes from the secret and not from something else, such as a logged-in session or a different URL.

Common false positives: the site may not use the cache plugin at all; the secret may have been changed after deployment; the bypass may also require a logged-in session; or the difference you see may come from the cache simply expiring. Repeat the comparison and control for timing.

In general, how it is fixed

The standard fix is to generate the secret per installation from a cryptographically secure random source during setup, store it only in the local configuration, and exclude that configuration from version control. Templates should ship a placeholder or a generation step, never a working default. If a secret has already been published, it should be treated as compromised and replaced on affected installations.

In general, where to look

This class of issue hides in reusable artefacts: installation templates, starter themes, container images, infrastructure-as-code examples and sample configuration files. Useful signals include public repositories that mention a cache plugin's configuration keys, documentation that shows a bypass cookie or parameter, and sites whose behaviour matches a template's defaults.

Glossary

  • Template (installation template): a starting set of files that people copy to create their own site.
  • Plugin: an add-on that gives a website extra features, here page caching.
  • Page cache: stored copies of pages that are handed to visitors instead of rebuilding the page each time.
  • Cache bypass: a way to tell the cache to skip itself and let the full application handle the request.
  • Secret: a password-like value that proves the sender is allowed to do something.
  • Hard-coded value: a value typed directly into a source file rather than generated or configured at setup.
  • Constant: a named value in code that is not meant to change while the program runs.
  • Repository: a project's storage on a code hosting service such as GitHub, including its full history.
  • Version control: the system that tracks changes to code and lets others read it.
  • Request: the message a browser sends to a server asking for a page or other resource.
  • Cookie: a small piece of data a site stores in the browser and the browser sends back with later requests.
  • Header: extra information attached to a request or response, such as content type or caching details.
  • Denial of service (DoS): making a service so busy or overloaded that legitimate visitors cannot use it.
  • Availability: whether a service keeps responding to its users.
  • Entropy: the amount of randomness in a value; more entropy means harder to guess.
  • Cryptographically secure random source: a generator of random values suitable for secrets, because its output cannot be predicted.
  • Rotation: replacing a secret with a new one, usually after it has been exposed.
  • False positive: a finding that looks like a problem but is not one.
  • CVSS: a standard scoring system for rating the severity of a vulnerability.
  • Bounty: a payment made to a researcher who reports a valid security issue.

More by e3amn2l

View all

8 more disclosed reports, best first.

More from Ian Dunn

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.