MediaWiki LocalSettings Credentials

Detects MediaWiki LocalSettings.php files containing database passwords ($wgDBpassword), secret keys ($wgSecretKey), and upgrade keys ($wgUpgradeKey). These are high-value secrets that grant database and administrative access to a MediaWiki installation. Mirrors Snaffler rule KeepPhpByName.

Type
regex
Engine
boost_regex
Confidence
high
Confidence justification
High confidence: $wgDBpassword, $wgSecretKey, and $wgUpgradeKey are specific MediaWiki PHP variables with no plausible false-positive context outside LocalSettings.php. The hex-constraint on $wgSecretKey (a-f0-9, 16+ chars) further pins the pattern to real secrets rather than documentation examples.
Jurisdictions
global
Regulations
GDPR, Criminal Code Act 1995 (Cth)
Frameworks
CIS Controls, ISO 27001, NIST CSF, PCI-DSS, SOC 2
Data categories
credentials, security, application-secrets
Scope
specific
Risk rating
9
Platform compatibility
Purview: Compatible, GCP DLP: Compatible, Macie: Compatible, Zscaler: Compatible, Palo Alto: Compatible, Netskope: Compatible

Pattern

\$wgDBpassword\s*=\s*['"][^'"]{1,}

Corroborative evidence keywords

wgDBserver, wgDBname, wgDBuser, MediaWiki, wgSecretKey, LocalSettings, wgSiteName, api key, api_key, apikey, access key, access token, auth token, authorization, bearer, conn str, connection string, connectionstring, cookie, credential (+40 more)

Proximity: 300 characters

Should match

Should not match

Known false positives

Collections