Block ClassDrupal extension · Four Kitchens

CVE-2025-3902

MEDIUM · 6.1 CVSS v3.1 Published 2025-04-23
Fix available
A fix is available. Upgrade to 4.0.1 or later.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in Drupal Block Class allows Cross-Site Scripting (XSS).This issue affects Block Class: from 4.0.0 before 4.0.1.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A stored Cross-Site Scripting (XSS) vulnerability in the Drupal Block Class module (versions 4.0.0 before 4.0.1) allows attackers to inject malicious JavaScript code through the Block Class functionality. The vulnerability stems from improper input neutralization during web page generation, enabling the execution of attacker-controlled scripts in the context of authenticated users' browsers.

MitigationUpgrade Drupal Block Class module from version 4.0.0 to version 4.0.1 or later to obtain the patch that properly sanitizes user input before rendering. Alternatively, restrict access to Block Class configuration to trusted users only until the update can be applied.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Block ClassDrupal extension
Affected:>= 4.0.0, < 4.0.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify if Block Class module is installed
    Check for the presence of the block_class module directory in Drupal's modules folder, typically at /modules/block_class or /modules/contrib/block_class. Also verify via Drupal admin UI at Extend page.
    Affected if Block Class module directory exists in the Drupal installation.
  2. Determine installed version of Block Class module
    Locate the block_class.info.yml or block_class.module file within the module directory and read the version declared in the .info.yml file's 'version' or 'core_version_requirement' field.
    Affected if Version is 4.0.0 (the only affected version in the provided range).
  3. Verify Block Class configuration access
    Check if any user roles have permission to 'Administer block classes' or 'Configure block settings' by reviewing /admin/people/permissions#module-block-class or by querying the permission table in Drupal database.
    Affected if Untrusted users have access to configure block class settings.
  4. Inspect stored block class configurations
    Query the Drupal database for any blocks that have custom class values stored. Look in tables like block or block_content for fields related to class names, typically searching for entries containing the string 'class' in configuration data.
    Affected if Any blocks exist with custom class values entered through the Block Class interface.
  5. Review block class input fields for unescaped output
    Place a test block with a class containing a script tag (e.g., <script>alert(1)</script>) in the Block Class field, then view the rendered page source to verify if the tag is rendered as plain text or executed as code.
    Affected if The script tags are rendered as active HTML/JS rather than being escaped or removed.

A site is affected if the Block Class module version 4.0.0 is installed AND any block has custom class values configured through the module's interface, allowing stored XSS to execute.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 4.0.1 or later
Fixed in 4.0.1
Interim mitigation

Upgrade Drupal Block Class module from version 4.0.0 to version 4.0.1 or later to obtain the patch that properly sanitizes user input before rendering. Alternatively, restrict access to Block Class configuration to trusted users only until the update can be applied.

Recommended fix High confidence

4.0.1

  1. Backup your Drupal site database and files before proceeding
  2. Update the Block Class module using Composer: composer update drupal/block_class --with-all-dependencies, or via the Drupal admin interface at /admin/modules
  3. Clear the Drupal cache after updating: drush cr all or via admin interface at /admin/config/development/performance
  4. Verify the module version shows 4.0.1 at /admin/modules or via drush pm-list --status=enabled --type=module
  5. Test that the block class functionality works correctly and the XSS vulnerability is mitigated
Caveat Minor module version update; unlikely to introduce breaking changes but test in non-production first

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Block Class Scoped from the published advisory
  • Consultation2.0 h
  • Implementation2.0 h
  • Testing4.0 h
  • Review / QA2.0 h
10.0 hours of engineering $1,720
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,752.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2025-3902 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-3902 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data