Contact Form 7WordPress extension · Rocklobster

CVE-2018-20979

CRITICAL · 9.8 CVSS v3.0 Published 2019-08-22
Fix available
A fix is available. Upgrade to 5.0.4 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

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
The contact-form-7 plugin before 5.0.4 for WordPress has privilege escalation because of capability_type mishandling in register_post_type.

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

The Contact Form 7 WordPress plugin before version 5.0.4 has a privilege escalation vulnerability caused by improper handling of capability_type when registering the custom post type for contact forms. This misconfiguration can allow authenticated users with lower privileges (such as subscribers) to create, edit, or delete contact forms they should not have access to, effectively escalating their capabilities beyond what their role should permit.

MitigationUpdate Contact Form 7 to version 5.0.4 or later to remediate the capability_type mishandling. If immediate update is not possible, audit user roles and consider restricting the contact_form post type capabilities until the patch 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
Contact Form 7WordPress extension
Affected:< 5.0.4

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
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

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. Check Contact Form 7 installed version
    In WordPress admin, go to Plugins > Installed Plugins and look for Contact Form 7, or inspect the main plugin file (typically wp-content/plugins/contact-form-7/readme.txt or contact-form-7.php) to find the Version: field in the file header. Alternatively, run: wp plugin list --name=contact-form-7
    Affected if The version listed is lower than 5.0.4 (for example: 5.0.3, 5.0.2, 4.9, etc.)
  2. Verify contact_form post type exists
    In WordPress, the plugin registers a custom post type called contact_form. Check if this post type exists by going to the admin sidebar: if you see a 'Contact' menu item with 'Contact Forms' submenu, the post type is registered. Alternatively, query the database or use get_post_type_object('contact_form') in code.
    Affected if The contact_form post type exists and is accessible to lower-privileged users such as subscribers
  3. Inspect capability_type setting for contact_form
    If you have code access, examine the wp-content/plugins/contact-form-7/includes/css/styles.php or the main plugin file where register_post_type is called. Look for the 'capability_type' argument in the register_post_type call for 'contact_form'. The vulnerable configuration uses 'post' as the capability_type, which grants edit_contact_form, delete_contact_form, etc. to all users with the 'edit_posts' capability.
    Affected if The capability_type is set to 'post' or defaults to 'post' without granular capability restrictions, which allows users with subscriber role (who have minimal capabilities) to create, edit, or delete contact forms

You are affected if Contact Form 7 version is below 5.0.4 AND the contact_form post type is registered with a capability_type that grants low-privilege users (such as subscribers) the ability to manage contact forms.

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 5.0.4 or later
Fixed in 5.0.4
Interim mitigation

Update Contact Form 7 to version 5.0.4 or later to remediate the capability_type mishandling. If immediate update is not possible, audit user roles and consider restricting the contact_form post type capabilities until the patch can be applied.

Recommended fix High confidence

Contact Form 7 version 5.0.4 or later

  1. Backup your WordPress site before making any changes
  2. Navigate to Plugins > Installed Plugins in WordPress admin dashboard
  3. Find Contact Form 7 in the plugin list
  4. Click 'Update now' if an update is available, or manually upload version 5.0.4 or later
  5. Verify the plugin version after update to confirm the fix is applied

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

Fix this in Contact Form 7 Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing3.0 h
  • Review / QA1.0 h
7.0 hours of engineering $1,190
Get the upgrade done

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

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2018-20979 — 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-2018-20979 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