# Custom Contact Forms <= 7.21.0 - Authenticated (Author+) Insecure Direct Object Reference to Arbitrary Post Overwrite via Form Creation REST Route

- **ID:** WPSEC-2026-4232
- **Plugin:** Custom Contact Forms (`custom-contact-forms`), https://wordpress.org/plugins/custom-contact-forms/
- **Affected versions:** from 7.0 before 7.22.0
- **Fixed in:** 7.22.0 (Update to 7.22.0 or later.)
- **Severity:** Medium 6.5 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N)
- **Weakness:** CWE-639
- **Usage among sites WPSec scans:** plugin Low, affected versions Low (as of 2026-11-29)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/custom-contact-forms
- **Fix released:** 2026-11-28
- **Published:** 2026-11-29
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4232/

## Description

The Custom Contact Forms plugin for WordPress is vulnerable to Insecure Direct Object Reference via the form creation REST API route (POST /wp-json/ccf/v1/forms) in all versions up to, and including, 7.21.0. This is due to the 'id' value in the request body being passed directly to wp_insert_post() as the post ID, without checking that the target post is a form or that the user is allowed to edit it. This makes it possible for authenticated attackers, with author-level access and above, to overwrite arbitrary posts, pages or forms, including content owned by other users and administrators. The overwritten post is turned into a published form, its title is replaced and its content is erased.

## References

- https://wpsec.com/vuln/WPSEC-2026-4232/
- https://plugins.svn.wordpress.org/custom-contact-forms/tags/7.22.0/
- https://wordpress.org/plugins/custom-contact-forms/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-4232/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
