Shared security patch analysis results
AI Used: claude_cli haikuComprehensive security analysis generated by AI for each confirmed CVE match. Click on a CVE to view the detailed writeup including vulnerability background, technical details, patch analysis, and PoC guide.
--- cache/user-submitted-posts_20260110/library/shortcode-access.php 2026-01-17 00:17:38.175057947 +0000+++ cache/user-submitted-posts_20260113/library/shortcode-access.php 2026-01-17 00:21:23.340574026 +0000@@ -1,17 +1,17 @@ <?php // User Submitted Posts - Access Control /* - Shortcode: require login based on capability+ Shortcode: display content based on user capability Syntax: [usp_access cap="read" deny=""][/usp_access] Can use {tag} to output <tag>- See @ https://codex.wordpress.org/Roles_and_Capabilities#Capabilities+ https://wordpress.org/documentation/article/roles-and-capabilities/ */+ if (!function_exists('usp_access')) :+ function usp_access($attr, $content = null) {- extract(shortcode_atts(array(- 'cap' => 'read',- 'deny' => '',- ), $attr));+ + extract(shortcode_atts(array('cap' => 'read', 'deny' => ''), $attr)); // deny message @@ -20,7 +20,7 @@ $deny = str_replace("{", "<", $deny); $deny = str_replace("}", ">", $deny); - $deny = preg_replace('#<script(.*)>(.*)</script>#is', '', $deny);+ $deny = wp_kses_post($deny); // content @@ -29,71 +29,112 @@ $content = str_replace("{", "<", $content); $content = str_replace("}", ">", $content); - $content = preg_replace('#<script(.*)>(.*)</script>#is', '', $content);+ $content = wp_kses_post($content); // $caps = array_map('trim', explode(',', $cap)); foreach ($caps as $c) {+ if (current_user_can($c) && !is_null($content) && !is_feed()) return do_shortcode($content);+ } return $deny;+ }+ add_shortcode('usp_access', 'usp_access');+ endif; /* - Shortcode: show content to visitors+ Shortcode: display content to visitors (not logged in) Syntax: [usp_visitor deny=""][/usp_visitor] Can use {tag} to output <tag> */+ if (!function_exists('usp_visitor')) : + function usp_visitor($attr, $content = null) {- extract(shortcode_atts(array(- 'deny' => '',- ), $attr));+ + extract(shortcode_atts(array('deny' => ''), $attr));+ + // deny message+ + $deny = htmlspecialchars($deny, ENT_QUOTES); $deny = str_replace("{", "<", $deny); $deny = str_replace("}", ">", $deny); - $deny = htmlspecialchars($deny, ENT_QUOTES);+ $deny = wp_kses_post($deny);+ + // content+ $content = htmlspecialchars($content, ENT_QUOTES); + $content = str_replace("{", "<", $content);+ $content = str_replace("}", ">", $content);+ + $content = wp_kses_post($content);+ + //+ if ((!is_user_logged_in() && !is_null($content)) || is_feed()) return do_shortcode($content); return $deny;+ }+ add_shortcode('usp_visitor', 'usp_visitor');+ endif; /* - Shortcode: show content to members+ Shortcode: display content to members (logged in) Syntax: [usp_member deny=""][/usp_member] Can use {tag} to output <tag> */+ if (!function_exists('usp_member')) :+ function usp_member($attr, $content = null) {- extract(shortcode_atts(array(- 'deny' => '',- ), $attr));+ + extract(shortcode_atts(array('deny' => ''), $attr));+ + // deny message+ + $deny = htmlspecialchars($deny, ENT_QUOTES); $deny = str_replace("{", "<", $deny); $deny = str_replace("}", ">", $deny); - $deny = htmlspecialchars($deny, ENT_QUOTES);+ $deny = wp_kses_post($deny);+ + // content+ $content = htmlspecialchars($content, ENT_QUOTES); + $content = str_replace("{", "<", $content);+ $content = str_replace("}", ">", $content);+ + $content = wp_kses_post($content);+ + //+ if (is_user_logged_in() && !is_null($content) && !is_feed()) return do_shortcode($content); return $deny;+ }+ add_shortcode('usp_member', 'usp_member');+ endif; @@ -101,16 +142,26 @@ /* Shortcode Empty Paragraph Fix */+ if (!function_exists('usp_shortcode_empty_p_fix')) :+ function usp_shortcode_empty_p_fix($content) {+ $array = array(+ '<p>[' => '[', ']</p>' => ']', ']<br />' => ']', ']<br>' => ']'+ );+ $content = strtr($content, $array);+ return $content;+ }+ add_filter('the_content', 'usp_shortcode_empty_p_fix');-endif;++endif;\ No newline at end of file
I'll analyze this code diff for security vulnerabilities.
Vulnerability Existed: yes
TRUE POSITIVE
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') - CWE-79 - library/shortcode-access.php Lines 23, 32
Old Code:
```php
$deny = preg_replace('#<script(.*)>(.*)</script>#is', '', $deny);
```
and
```php
$content = preg_replace('#<script(.*)>(.*)</script>#is', '', $content);
```
Fixed Code:
```php
$deny = wp_kses_post($deny);
```
and
```php
$content = wp_kses_post($content);
```
Explanation:
The original code attempted to sanitize user input by using a regex pattern to strip only `<script>` tags. This is insufficient because:
1. It only removes `<script>` tags but allows other dangerous HTML attributes and event handlers (e.g., `<img onerror="alert('xss')" />`, `<div onload="...">`)
2. The regex pattern can be bypassed with variations like `<SCRIPT>`, case variations, or nested tags
3. Other dangerous HTML/JavaScript vectors like style tags, iframe tags, and event handlers would pass through
The fix uses `wp_kses_post()`, which is WordPress's proper HTML sanitization function that:
1. Whitelists allowed HTML tags and attributes
2. Removes all potentially dangerous content
3. Is the standard WordPress approach for sanitizing post content
---
Vulnerability Existed: yes
FALSE POSITIVE
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') - CWE-79 - library/shortcode-access.php Lines 59, 75 (usp_visitor and usp_member functions)
Old Code:
```php
$deny = htmlspecialchars($deny, ENT_QUOTES);
$content = htmlspecialchars($content, ENT_QUOTES);
```
Fixed Code:
```php
$deny = htmlspecialchars($deny, ENT_QUOTES);
$deny = str_replace("{", "<", $deny);
$deny = str_replace("}", ">", $deny);
$deny = wp_kses_post($deny);
$content = htmlspecialchars($content, ENT_QUOTES);
$content = str_replace("{", "<", $content);
$content = str_replace("}", ">", $content);
$content = wp_kses_post($content);
```
Explanation:
The original code used only `htmlspecialchars()` for sanitization, which escapes HTML entities but doesn't remove dangerous tags. After the `{` and `}` replacement (converting them to `<` and `>`), the code would have unescaped HTML tags that could contain XSS payloads. The fix properly applies `wp_kses_post()` after the character replacements to ensure all HTML content is properly sanitized and only safe tags/attributes are allowed.
The User Submitted Posts – Enable Users to Submit Posts from the Front End plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's 'usp_access' shortcode in all versions up to, and including, 20260110 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
--- cache/user-submitted-posts_20260110/user-submitted-posts.php 2026-01-17 00:17:38.179058186 +0000+++ cache/user-submitted-posts_20260113/user-submitted-posts.php 2026-01-17 00:21:23.348574509 +0000@@ -10,8 +10,8 @@ Contributors: specialk Requires at least: 4.7 Tested up to: 6.9- Stable tag: 20260110- Version: 20260110+ Stable tag: 20260113+ Version: 20260113 Requires PHP: 5.6.20 Text Domain: usp Domain Path: /languages@@ -38,7 +38,7 @@ if (!defined('ABSPATH')) die(); if (!defined('USP_WP_VERSION')) define('USP_WP_VERSION', '4.7');-if (!defined('USP_VERSION')) define('USP_VERSION', '20260110');+if (!defined('USP_VERSION')) define('USP_VERSION', '20260113'); if (!defined('USP_PLUGIN')) define('USP_PLUGIN', 'User Submitted Posts'); if (!defined('USP_FILE')) define('USP_FILE', plugin_basename(__FILE__)); if (!defined('USP_PATH')) define('USP_PATH', plugin_dir_path(__FILE__));
I've analyzed the provided code diff for security vulnerabilities. **Analysis Result:** Vulnerability Existed: no **Explanation:** This diff contains only version number updates across three locations in the `user-submitted-posts.php` file: - Plugin header `Stable tag` field (line 13) - Plugin header `Version` field (line 14) - PHP constant definition `USP_VERSION` (line 41) All changes update the version from `20260110` to `20260113`. These are routine version bumps with no code logic modifications, no new functionality, and no security-related changes. **Security Assessment:** - No input validation changes - No authentication/authorization modifications - No cryptographic operations affected - No external API interactions altered - No file operations or database queries changed - No string handling or escaping modifications The diff represents a standard version increment with no security implications. No vulnerabilities are present in this code change.
The User Submitted Posts – Enable Users to Submit Posts from the Front End plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the plugin's 'usp_access' shortcode in all versions up to, and including, 20260110 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.