<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhan Luo on Medium]]></title>
        <description><![CDATA[Stories by Muhan Luo on Medium]]></description>
        <link>https://medium.com/@muhan.luo?source=rss-8fa4f141e788------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CkguYQ5KRVBd5r9Ws3Devg.jpeg</url>
            <title>Stories by Muhan Luo on Medium</title>
            <link>https://medium.com/@muhan.luo?source=rss-8fa4f141e788------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:54:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muhan.luo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hunting CVEs in WordPress Plugins using Claude + Semgrep]]></title>
            <link>https://infosecwriteups.com/hunting-cves-in-wordpress-plugins-using-claude-semgrep-1f0c82453356?source=rss-8fa4f141e788------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f0c82453356</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Muhan Luo]]></dc:creator>
            <pubDate>Sun, 17 May 2026 19:33:10 GMT</pubDate>
            <atom:updated>2026-08-22T17:39:10.434Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJdy-GWW_pgrvpGcb2v-CA.png" /></figure><p>For the last couple of months, I’ve been working on building a workflow to help me find vulnerabilities in WordPress plugins. Thus far, my system has helped me find 7 vulnerabilities. 3 have been publicly disclosed and 4 more are waiting to be disclosed.</p><p>As of writing, here are the three vulnerabilities that have been publicly disclosed:</p><ul><li>(<a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/woo-jtl-connector/jtl-connector-for-woocommerce-241-missing-authorization-to-authenticated-subscriber-settings-modification-via-multiple-functions">CVE-2026–9234</a>) A low-level user can modify settings which only admin users should be allowed to</li><li>(<a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/woorewards/myrewards-573-missing-authorization">CVE-2026–40786</a>) A low-level user can perform admin-level actions like like resetting the database and deleting all customer loyalty points.</li><li>(<a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/wppizza/wppizza-a-restaurant-plugin-3199-authenticated-subscriber-information-exposure">CVE-2026–40796</a>) A low-level user can access sensitive PII through an IDOR vulnerability.</li></ul><p>Additionally, my vulnerability hunting workflow also helped me discover many unpatched vulnerabilities. These vulnerabilities were already reported and publicly disclosed but had not been fixed as of writing. Here are 2 notable examples:</p><ul><li>(<a href="https://patchstack.com/database/wordpress/plugin/wp-link-preview/vulnerability/wordpress-wp-link-preview-plugin-1-4-1-server-side-request-forgery-ssrf-vulnerability">CVE-2025–31527</a>) A low-level user is capable of performing SSRF.</li><li>(<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-68039">CVE-2025–68039</a>) A low-level user can download backup files.</li></ul><p>This article will focus on how I built this workflow.</p><h3>Background</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxnRWsZFuN7uW_rL0rDANA.png" /><figcaption>List of CVEs currently on my <a href="https://www.wordfence.com/threat-intel/vulnerabilities/researchers/muhan-luo">WordFence account</a></figcaption></figure><p>Since early 2025, I have been trying to improve my secure code-review skills. I liked the code review exercises on PentesterLab, but I realized I would learn a lot more if I practiced these skills on actual software. WordPress plugins are a great option because they’re free, the code is publicly accessible, and there are tens of thousands of plugins available to review.</p><p>At the time, I had very little experience with WordPress, so I spent time learning WordPress security through online blogs. I found WordFence’s <a href="https://www.wordfence.com/blog/2024/07/wordpress-security-research-a-beginners-series/">Beginner Series</a> and <a href="https://www.wordfence.com/wp-content/uploads/2021/07/Common-WordPress-Vulnerabilities-and-Prevention-Through-Secure-Coding-Best-Practices.pdf">list of common WordPress vulnerabilities</a> to be especially useful. While there was a decent learning curve, my effort eventually paid off when I found a stored XSS vulnerability in a plugin with 20,000+ active installs (<a href="https://www.cve.org/CVERecord?id=CVE-2025-4406">CVE-2025–4406</a>). You can read my writeup <a href="https://medium.com/@muhan.luo/cve-2025-4406-writeup-stored-xss-on-wpforo-forum-0bc2e5917219">here</a>.</p><p>Later that year, I also became interested in learning how to use static analysis security testing (SAST) tools like CodeQL and Semgrep to help expedite code review. What these tools allow you to do is create rules to detect patterns in code. The screenshot below shows a Semgrep rule which detects usages of eval() where the first argument includes a variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qajr-XyPkt_pHLOLiWaQkA.png" /><figcaption>This Semgrep rule detects usages of the eval() function in JS where the first argument includes a variable.</figcaption></figure><p>I decided to combine my interest in SAST tools with WordPress by creating Semgrep rules to detect common vulnerable patterns in WordPress plugins (available on my <a href="https://github.com/muhanLuo/wordpress-plugin-semgrep-rules">GitHub</a>). My plan was to use these rules to scan the top 10,000 WordPress plugins to find security vulnerabilities and earn bug bounties.</p><p>Unfortunately, my initial attempts to find vulnerabilities were unsuccessful. The problem is that Semgrep produced thousands of findings, but almost all of them were false positives. It was incredibly draining to spend hours triaging these findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fl6EUYkFsaecX6p8sua6dA.png" /><figcaption>Semgrep would often produce 1000s of findings, almost all of which were false positive</figcaption></figure><p>What inspired me to start this project was this blog post by <a href="https://github.blog/security/ai-supported-vulnerability-triage-with-the-github-security-lab-taskflow-agent/">GitHub Security</a> titled <em>AI-supported vulnerability triage with the GitHub Security Lab Taskflow Agent. </em>The article describes how the GitHub security team was getting overwhelmed by the huge numbers of false positives coming from their static analysis tools and were able to fix this by offloading work to an LLM. The LLM reviewed the findings and filtered out false positives, which saved the team a lot of time. I realized this approach would fit perfectly into my Semgrep workflow and decided to implement something similar.</p><h3>Methodology</h3><p>I didn’t want to spend too much money on tokens, so I decided the best approach would be to focus on just one class of vulnerabilities. The idea I settled on was to look for missing authorization vulnerabilities in AJAX hooks. In WordPress, AJAX hooks are basically API endpoints that can be called by all users, including low-privilege ones. When an AJAX hook is called by a user, the AJAX hook invokes its callback function.</p><p>In the example below, the wp_ajax_get_user_data AJAX hook is registered using add_action().</p><pre>&lt;?php<br>// Register AJAX hook<br>add_action( &#39;wp_ajax_get_user_data&#39;, &#39;handle_get_user_data&#39; );<br><br>function handle_get_user_data() {<br>    // Verify nonce<br>    check_ajax_referer( &#39;get_user_data_nonce&#39;, &#39;nonce&#39; );<br><br>    $user_id = isset( $_POST[&#39;user_id&#39;] ) ? absint( $_POST[&#39;user_id&#39;] ) : 0;<br><br>    if ( ! $user_id ) {<br>        wp_send_json_error( &#39;Invalid user ID&#39;, 400 );<br>    }<br><br>    $user = get_userdata( $user_id );<br>    wp_send_json_success( [ &#39;username&#39; =&gt; $user-&gt;user_login ] );<br>}</pre><ul><li>The handle_get_user_data() function is registered as the callback to the wp_ajax_get_user_data AJAX hook.</li><li>When the wp_ajax_get_user_dataAJAX hook is triggered, its associated callback function, handle_get_user_data() is invoked.</li></ul><p>Similar to many API frameworks, AJAX hooks do not implement any authorization checks by default. If a developer fails to verify the user’s permissions using a function such as <a href="https://developer.wordpress.org/reference/functions/current_user_can/">current_user_can()</a> in the body of the callback, a low-privileged user can potentially perform actions which they shouldn’t be allowed to.</p><p>My plan was this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iV_vkFpWrrINh1V5wGvAfg.png" /></figure><ol><li>I would download the top 10,000 most installed WordPress plugins.</li><li>For each plugin, I would use Semgrep to detect AJAX hooks whose callback function did not include any authorization checks.</li><li>Claude would analyze the Semgrep output and score each finding from 1–5 (1 being a false-positive, 5 a high-severity issue).</li><li>I would manually review Claude’s analysis.</li><li>If Claude’s analysis seemed correct, I would perform dynamic testing.</li></ol><h4>Step 1 - Downloading WordPress plugins</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3P9qNRI09Ju3rotFIjSOwQ.png" /></figure><p>I thought downloading the top 10,000 plugins would be a chore, but thankfully WordPress implemented an <a href="https://api.wordpress.org/plugins/info/1.2/?action=query_plugins">API</a> for their plugin directory. This allowed me to write a simple Python script to perform this task. You can find this script on my <a href="https://gist.github.com/muhanLuo/28dc4874f1f29fb785ca89f47a62153a">GitHub</a>.</p><h4>Step 2: Semgrep Scan</h4><p>Next, I needed to create a Semgrep rule to identify AJAX hook callbacks without authorization checks implemented. I found this article by a <a href="https://noob3xploiter.medium.com/automating-csrf-detection-in-wordpress-plugins-with-semgrep-52ece2c212b7">Brandon Roldan</a>, who found many CSRF vulnerabilities in WordPress plugins using Semgrep, to be very helpful.</p><p>Here is the rule I ended up writing (You can find it on my <a href="https://github.com/muhanLuo/wordpress-plugin-semgrep-rules/blob/main/missing-auth/wp-ajax-hook-missing-auth.yml">GitHub</a>). Note that you have to login into Semgrep to use this rule since join mode is not enabled for unauthenticated users.</p><pre>rules:<br>- id: wp-ajax-hook-missing-auth<br>  # Metavariable Focus<br>  mode: join<br>  join:<br>    rules:<br>      - id: add-action-results<br>        languages: [php]<br>        patterns:<br>          - pattern-either:<br>              - pattern: add_action(&#39;$ACTION&#39;, [..., &#39;$HOOK_FUNC&#39;], ...);<br>              - pattern: add_action(&#39;$ACTION&#39;, &#39;$HOOK_FUNC&#39;, ...);<br>          - metavariable-regex:<br>              metavariable: $ACTION<br>              regex: (wp_ajax_.*|admin_post_.*|admin_action_.*)<br><br>        message: Detects usages of add-action<br>        severity: INFO<br><br>      - id: no-auth-functions-results<br>        languages:<br>          - php<br>        patterns:<br>          - pattern: |<br>              function $CALLBACK(...) {<br>                ...<br>              }<br>          - pattern-not:<br>              patterns:<br>                - pattern: |<br>                    function $CALLBACK(...) {<br>                      ...<br>                      if (&lt;... $WP_VERIFY(...) ...&gt;)<br>                      {<br>                        ...<br>                      }<br>                      ...<br>                    }<br>                - metavariable-regex:<br>                    metavariable: $WP_VERIFY<br>                    regex: (current_user_can|wp_verify_nonce|check_ajax_referer|check_admin_referer)<br>          - pattern-not: function $CALLBACK(...) { ... check_ajax_referer(...); ... }<br>          - pattern-not: function $CALLBACK(...) { ... check_admin_referer(...); ... }<br>          <br>        message: These functions did not have a function like &quot;current_user_can&quot; or &quot;check_ajax_referer&quot; in their body.<br>        severity: INFO<br><br>    on:<br>      - &#39;add-action-results.path == no-auth-functions-results.path&#39; # We need a check to ensure that &quot;add_action()&quot; and the callback called by &quot;add_action()&quot; are in the same file.<br>      - &#39;add-action-results.$HOOK_FUNC == no-auth-functions-results.$CALLBACK&#39; # Only return functions which are called by &quot;add_action()&quot;<br><br>  message: These hooks did not have a corresponding current_user_can() for their<br>      callback, which might indicate a missing authorization vulnerability. Only<br>      hooks usually associated with high-severity access control vulnerabilities<br>      are marked.<br>  severity: INFO</pre><p><strong>Explanation</strong></p><p>This Semgrep rule matches an AJAX hook’s callback function if the callback does not have authorization checks implemented. Here’s a quick breakdown of how the rule works:</p><ol><li>The first part of the rule matches instances of add_action() where an AJAX hook is being registered. So usages of add_action($ACTION, ...) where $ACTION matches the following regex: (wp_ajax_.*|admin_post_.*|admin_action_.*)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*nzKeftXhiBsbyyU41LkZtw.png" /></figure><p>2. This second part the rule finds any function which does not contain current_user_can(), wp_verify_nonce() , check_ajax_referer() , and check_admin_referer() in their body. These functions perform authorization checks.¹</p><pre>- id: no-auth-functions-results<br>      languages:<br>        - php<br>      patterns:<br>        - pattern: |<br>            function $CALLBACK(...) {<br>              ...<br>            }<br>        - pattern-not:<br>            patterns:<br>              - pattern: |<br>                  function $CALLBACK(...) {<br>                    ...<br>                    if (&lt;... $WP_VERIFY(...) ...&gt;)<br>                    {<br>                      ...<br>                    }<br>                    ...<br>                  }<br>              - metavariable-regex:<br>                  metavariable: $WP_VERIFY<br>                  regex: (current_user_can|wp_verify_nonce|check_ajax_referer|check_admin_referer)<br>        - pattern-not: function $CALLBACK(...) { ... check_ajax_referer(...); ... }<br>        - pattern-not: function $CALLBACK(...) { ... check_admin_referer(...); ... }<br></pre><ul><li>The last part of the rule tells Semgrep to return all functions without authorization checks (from #2), but only if the functions are used as an AJAX hook’s callback (from #1).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TyflSIFR8RhhInnkvsXKsw.png" /></figure><p><strong>Examples of the Rule in Action</strong></p><p>✅Example 1: Semgrep Matches update_dismiss_status_ajax()</p><pre>add_action( &#39;wp_ajax_update_dismiss_status&#39;, &#39;update_dismiss_status_ajax&#39; );<br><br>function update_dismiss_status_ajax() {<br>    $isdismiss = isset( $_POST[&#39;isdismiss&#39;] ) ? $_POST[&#39;isdismiss&#39;] : false;<br>    update_option( &#39;tho-klaviyo-isdismiss&#39;, $isdismiss );<br><br>    wp_die();<br>}</pre><p>Explanation:</p><ul><li>There’s no function which performs authorization checks in update_dismiss_status_ajax()</li><li>An AJAX hook (wp_ajax_update_dismiss_status) registers update_dismiss_status_ajax() as its callback.</li></ul><p>❌Example 2: No Match</p><pre>add_action(&#39;wp_ajax_bmi_gdrive_banner&#39;, [&amp;$this, &#39;handle_banner_action&#39;]);<br><br>public function handle_banner_action() {<br>  if (!current_user_can(&#39;manage_options&#39;)) return wp_send_json_error();<br><br>  $mode = sanitize_text_field($_POST[&#39;mode&#39;]);<br>  if ($mode == &#39;dismiss&#39;) update_option(&#39;bmi_gdrive_banner_dismissed&#39;, true);<br><br>}</pre><p>Explanation: handle_banner_action() is not matched because it includes current_user_can() in its body.</p><p>❌Example 3: No Match</p><pre>add_action( &#39;wp_ajax_goodbye_form&#39;, array( $this, &#39;goodbye_form_callback&#39; ) );<br><br>public function goodbye_form_callback() {<br>   check_ajax_referer( &#39;wisdom_goodbye_form&#39;, &#39;security&#39; );<br>  <br>   if ( isset( $_POST[&#39;values&#39;] ) ) {<br>    $values = wp_json_encode( array_map( &#39;sanitize_text_field&#39;, wp_unslash( $_POST[&#39;values&#39;] ) ) );<br>    update_option( &#39;wisdom_deactivation_reason_&#39; . $this-&gt;plugin_name, $values );<br>   }<br>  <br>   if ( isset( $_POST[&#39;details&#39;] ) ) {<br>    $details = sanitize_text_field( wp_unslash( $_POST[&#39;details&#39;] ) );<br>    update_option( &#39;wisdom_deactivation_details_&#39; . $this-&gt;plugin_name, $details );<br>   }<br>  <br>   $this-&gt;do_tracking(); // Run this straightaway.<br>   echo &#39;success&#39;;<br>   wp_die();<br>}</pre><p>Explanation: goodbye_form_callback is not matched because it includes check_ajax_referer() in its body.</p><p>❌Example 4: No Match</p><pre>public function get_user() {<br><br>$user = getUserByInfo($_POST[&#39;id&#39;]);<br><br>if ($user) {<br>    echo &quot;Name: {$user[&#39;name&#39;]}, Role: {$user[&#39;role&#39;]}&quot;;<br>} <br>else {<br>    echo &quot;User not found.&quot;;<br>}<br><br>}</pre><p>Explanation: get_user() is not matched even though there’s no authorization checks because it’s never registered as an AJAX hook’s callback function.</p><h4>Step 3: Creating the Prompt</h4><p>After running Semgrep on each plugin’s codebase, I used Claude to sort through the false positives. For instance, in example 1, even though update_dismiss_status_ajax() was matched by Semgrep, it isn’t actually a security issue. All the callback does is set an option to dismiss a pop-up, so it doesn’t really matter if a low-level user can call it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhJPucGl137Cja9OpsXkSw.png" /><figcaption>A screenshot of me experimenting with my system prompt on the Claude Console</figcaption></figure><p>I honestly didn’t spend that much time on the prompt. While it worked, I think there were definitely improvements to be made (see the conclusion for more). Basically, I asked Claude to produce a score from 1–5 of how likely this is a security issue based on the following criteria:</p><ol><li>Does this callback function seem to implement some sort of authorization check? If so, downgrade the score.</li><li>Is it actually a problem if a low-level user can call this function? If the function is not a mutating/business-critical operation, downgrade the score.</li></ol><blockquote>You are an expert application security engineer reviewing WordPress PHP code. You will be provided with a PHP function snippet (let’s call this $VULN_FUNC) which was found to not include capability checks or nonce verification according to Semgrep. This was determined by looking for functions which did not contain any of these functions in their body: current_user_can(), wp_verify_nonce(), check_ajax_referer(), and check_admin_referer().</blockquote><blockquote>Your goal is to determine if it would be a security risk if $VULN_FUNC could be called by a Subscriber-level user in WordPress. You will return a risk score from 1–5 ( 1 meaning very low security risk and 5 very high security risk).</blockquote><blockquote>Score 5: High likelihood + High impact (e.g., arbitrary file deletion, SQL injection)<br>Score 4: High likelihood + Medium impact OR Medium likelihood + High impact<br>Score 3: Medium likelihood + Medium impact<br>Score 2: Low likelihood OR low impact<br>Score 1: Minimal risk (e.g., reading non-sensitive public data)</blockquote><blockquote>Your methodology for determining the score is as follows:</blockquote><blockquote>- First, determine the likelihood of exploitation. We are only looking functions with no-auth and which do not perform nonce checks. If $VULN_FUNC’s body contains any function whose name strongly suggests that it performs nonce verification or authorization checks, significantly lower the score. (Ex: check_nonce(), verify_auth(), but obviously not limited to these examples) Important note that the is_admin() function in WordPress does not actually check for authorization. If uncertain, err towards lower scores.<br>- Next, determine the impact. If $VULN_FUNC could be called by a Subscriber-level user, would this be a security issue? For example, downgrade the score if $VULN_FUNC doesn’t appear to take user input and/or doesn’t perform any sensitive or business critical mutating operations. Again, err towards lower scores if uncertain.</blockquote><blockquote>Your return format should be a string that follows this format:</blockquote><blockquote>score, explanation</blockquote><blockquote>”score” should be an integer value 1–5 representing the risk score determined. The second part ”explanation” should contain a very brief (150 words or less) explanation of how the score was determined.</blockquote><p>You can find the script I used to automate the Semgrep Scan + Claude Analysis on my <a href="https://gist.github.com/muhanLuo/8c888dc2764a55724eeadf035b830e98">GitHub</a>.</p><h4>Step 4: Reviewing the Output</h4><p>Once Semgrep and Claude both finished running, I would review the scan output using a VS Code extension called <a href="https://github.com/trailofbits/vscode-sarif-explorer">SARIF Explorer</a>. This extension keeps track of what findings you’ve already reviewed and which ones you’re done reviewing. I’ve found this tool to be extremely useful. It has many features, such as the ability to mark findings as false positives or bugs, leave comments, and filter findings by keywords which I haven’t found in other tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aogEova58GdokpuCK0Lhpw.png" /><figcaption>Interface for SARIF Explorer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvSZsiRv8tYCGbFuQgCPoA.png" /><figcaption>Another great SARIF explorer feature is that it opens up the file and highlights the exact snippet of code matched by a rule.</figcaption></figure><p>The search feature was especially useful, as it allowed me to focus on findings that were more likely to be serious issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2XP7oN6y-AFcHRg2CPqKUQ.png" /></figure><h4>Step 5: Dynamic Testing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNWa0YLj1wwyuYWThAw5Hg.png" /><figcaption>Screenshot of my locally-hosted instance of WordPress</figcaption></figure><p>After reviewing the code, I would perform dynamic testing to produce a proof-of-concept (POC) if I thought the vulnerability was actually exploitable. I ran a locally-hosted instance of WordPress on Docker using the “<em>Wordfence Docker WordPress Research Lab” </em>as my pre-configured environment.</p><p><a href="https://github.com/wordfence/bbp-dockerwp">GitHub - wordfence/bbp-dockerwp: Wordfence Docker WordPress Research Lab</a></p><p>I personally liked this setup because all you need to do to start WordPress is run docker-compose up (You can find more detailed instructions <a href="https://www.wordfence.com/blog/2025/05/wordpress-security-research-series-setting-up-your-research-lab/">here</a>). It’s also nice because a debugger is directly integrated with WordPress, which makes it easy to step through the code. This saved me lots of time when producing a POC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-TkEtk9wyw0EzqxHZIGBg.png" /><figcaption>Screenshot of me using the XDebug, a PHP debugger, in VSCode to produce a POC for <a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/woorewards/myrewards-573-missing-authorization">CVE-2026–40786</a></figcaption></figure><p>Finally, after discovering a vulnerability, I would report my finding to either <a href="https://patchstack.com/bug-bounty/">Patchstack</a> or <a href="https://www.wordfence.com/threat-intel/bug-bounty-program/">Wordfence</a>’s bug bounty platform. WordFence has a more strict scope for bug bounties (100,000+ active installations for most vulnerabilities), but allows you to submit out-of-scope (OOS) reports, while Patchstack has a more lax scope (1,000+ active installations for most vulnerabilities), but does not allow OOS reports.</p><h3>Conclusion</h3><h4>What Went Well</h4><ul><li>The entire process was pretty cheap. Reviewing ~11,000 Semgrep findings with Claude Opus 4.6 only cost around $120.</li><li>Claude was very good at filtering out obvious false positives. I took a quick look at about 100 of the findings Claude scored as either 1 or 2 (i.e. unlikely to be security issues). All of them were clearly non-issues. They either had an authorization check that wasn’t detected by Semgrep and/or the callback function performed actions which had no security impact (like upvoting a post). This reduced the amount of findings to review from ~11,000 → ~1,400.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srndrk5Imh8aUOQfb2_ZOg.png" /><figcaption>Finding which Claude correctly marked as a false positive</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAn844UNxzUn1YC-M-vfjA.png" /><figcaption>Snippet of code which Claude correctly marked as a false positive</figcaption></figure><ul><li>AI helped me discover vulnerabilities I otherwise wouldn’t have. For instance, I had absolutely almost no understanding of anything WooCommerce-related before I started. In the end, the majority of the vulnerabilities I discovered ended up being related to WooCommerce.</li></ul><h4>What Could Have Been Improved</h4><ul><li>While Claude was very good at filtering out most false positives, It definitely wasn’t perfect, especially when it came to understanding WordPress-specific security. For example, there were several instances where Claude thought that a function was vulnerable to SQL injection, when it actually wasn’t. Claude didn’t seem to be aware that WordPress automatically escaped quotes in superglobals like $_GET or $_POST.² Similarly, Claude did not understand that file upload functions in WordPress like media_handle_upload() or wp_handle_upload() were secure against webshell upload attacks. Next time, I think I should create a Claude skill containing WordPress specific-knowledge to further reduce the false positive rate.</li></ul><pre>&lt;?php<br><br>/* <br>Example: This code is NOT vulnerable to SQL injection in WordPress because of wp_magic_quotes()<br>*/<br><br>$post_id = $_GET[&#39;post_id&#39;]; // Automatically escaped by wp_magic_quotes()<br>$query = &quot;SELECT * FROM wp_posts WHERE ID = &#39;&quot; . $post_id . &quot;&#39;&quot;;</pre><ul><li>I also think I should’ve been more specific to Claude as to what counts as a business-critical operation. While the ability to deface the site layout, perform denial of service, and view private posts are all technically security issues, none of these vulnerabilities are in-scope for either Patchstack or Wordfence’s bug bounty programs.</li><li>The Semgrep rule I wrote took a long time to run on large code bases. I’m not sure why, but join-mode in Semgrep seems to use a lot of memory. I actually crashed my computer initially by trying to run the rule on every single plugin codebase at once. I thought it might’ve be an issue with my computer, so I tried it on a 32 GB RAM EC2 instance, but it also crashed about 1/4 of the way through. This is what caused me to eventually write a script to scan each plugin codebase individually. I’m wondering if there’s a way to significantly improve the performance of this rule.</li></ul><p>If you enjoyed this article, please like and share it so more people will be exposed to the article.</p><p>Also consider giving me a follow on LinkedIn: <a href="https://www.linkedin.com/in/muhan-luo-620259171/">https://www.linkedin.com/in/muhan-luo-620259171/</a>. I plan on writing much more in the future.</p><p>You can also find my GitHub right here: <a href="https://github.com/muhanLuo">https://github.com/muhanLuo</a></p><h3>Footnotes</h3><ol><li>Technically, wp_verify_nonce() doesn’t actually verify the user’s role, it just verifies that the user’s CSRF token (nonce) is valid. However, in practice, I’ve found that this function prevents a lot of attacks because getting a valid nonce requires access to certain admin pages which low-level users can’t access.</li><li>You can find a really in-depth guide on how to find SQL Injection in WordPress plugins on WordFence’s blog <a href="https://www.wordfence.com/blog/2025/08/how-to-find-sql-injection-vulnerabilities-in-wordpress-plugins-and-themes/">here</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f0c82453356" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/hunting-cves-in-wordpress-plugins-using-claude-semgrep-1f0c82453356">Hunting CVEs in WordPress Plugins using Claude + Semgrep</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2025–4406 Writeup: Stored XSS on wpForo Forum]]></title>
            <link>https://medium.com/@muhan.luo/cve-2025-4406-writeup-stored-xss-on-wpforo-forum-0bc2e5917219?source=rss-8fa4f141e788------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bc2e5917219</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[xss-bypass]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[wordpress-plugins]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Muhan Luo]]></dc:creator>
            <pubDate>Sat, 14 Feb 2026 05:46:19 GMT</pubDate>
            <atom:updated>2026-02-14T05:46:19.156Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHbRaJ4QZq22fnvIbUF2wA.png" /></figure><p>Last May, I discovered a stored XSS vulnerability in “wpForo Forum”, a WordPress plugin with over 20,000 active installations. Similar to other forum software like XenForo and phpBB, wpForo Forum allows users to create boards and topics for discussions on various subjects.</p><p>The vulnerability I found was in the avatar upload functionality. A user can upload an SVG file containing malicious Javascript because the sanitization was improperly implemented.</p><p>“wpForo Forum” uses WordPress’ built-in HTML sanitizer <a href="https://developer.wordpress.org/reference/functions/wp_kses/">wp_kses()</a> to perform sanitization. The problem is that wp_kses() only strips the javascript: protocol from thehref attribute, but not from xlink:href. I discovered this by accident while experimenting around with the wp_kses() function.</p><p>I reported this issue with wp_kses() to WordPress’ bug bounty program, but the WordPress team stated that this was not an issue since wp_kses() is not intended for XML sanitization.</p><p>If you’re interested in doing security research on WordPress plugins like me, here are some really good resources to get started:</p><ul><li><a href="https://www.wordfence.com/blog/2024/07/wordpress-security-research-a-beginners-series/">WordPress Security Research: A Beginner’s Series</a>: This series of articles discusses the basics of how WordPress works, how to setup a testing environment, and techniques for identifying vulnerabilities in WordPress plugins. These articles are written by the team at WordFence, who run the most popular WordPress firewall plugin as well as a bug bounty program for WordPress plugins.</li><li><a href="https://patchstack.com/academy/welcome/">Patchstack Academy</a>: This website teaches the basics of WordPress security and how to find common vulnerabilities in WordPress plugins. Patchstack also runs a popular firewall plugin and a popular bug bounty program for WordPress plugins.</li></ul><h3>Proof of Concept</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rNoBxs_FW03VMUdUXy1kQQ.png" /></figure><ol><li>Register as a forum user on a website with a vulnerable version of “wpForo Forum”.</li><li>Submit 3 posts and have them all approved by a moderator. You will need to do this to be able to edit your profile.</li><li>Once you gain the permission to edit your profile, upload the SVG below as an avatar. This SVG is just a red circle which triggers javascript:alert(‘XSS’) when clicked. Note that this value is emplaced in the xlink:href attribute.</li></ol><pre>&lt;svg xmlns=”http://www.w3.org/2000/svg&quot; xmlns:xlink=”http://www.w3.org/1999/xlink&quot;&gt;<br> &lt;a xlink:href=”javascript:alert(‘XSS’)”&gt;<br> &lt;circle r=”45&quot; cx=”100&quot; cy=”100&quot; fill=”red” /&gt;<br> &lt;/a&gt;<br>&lt;/svg&gt;</pre><p>4. When the SVG has been uploaded successfully, right-click on the profile picture and click “Open image in new tab”.</p><p>5. Click on the red circle. An “XSS” popup should show up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLOKMfXFkiD_t9tQ_pzS5g.png" /></figure><h3>Root Cause Analysis</h3><p>The upload_avatar() function calls a function wpforo_check_for_svg() to validate SVG files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoJKGlb_txJGY_wgZ8oPgg.png" /><figcaption>upload_avatar()</figcaption></figure><p>wpforo_check_for_svg() verifies that the uploaded file’s extension belongs to an image and that the MIME type is either image/svg+xml or image/svg. If these checks are passed, wpforo_sanitize_svg() is called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsruSnd_jRX2xl8FQg9mcg.png" /><figcaption>wpforo_check_for_svg()</figcaption></figure><p>wpforo_sanitize_svg() gzip decodes the SVG if it’s gzipped, then passes the SVG to wp_foro_kses() for sanitization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57bh7DqVhX-4kOKxoXtmIQ.png" /><figcaption>wpforo_sanitize_svg()</figcaption></figure><p>wpforo_kses() sets the allowed HTML tags and attributes depending on what is passed in the $keyargument (in this case ‘svg’). Finally wp_kses() (Note: not the same function as wpforo_kses()) is called, which sanitizes the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kbk0eEYj79vr0O-M3Wnj_A.png" /></figure><p>In the case of SVGs, the list of allowed attributes includes xlink:href. But as we noted earlier, this is bad because wp_kses() does not strip the javascript: protocol from the xlink:href attribute! This is the root cause of the XSS vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*1tqdQ3q-iZIShjlusxoLVw.png" /><figcaption>$allowed_attrs for SVGs</figcaption></figure><p>If you enjoyed this article, follow me on LinkedIn where I frequently post tips and tricks which have helped me be a better security engineer: <a href="https://www.linkedin.com/in/muhan-luo-620259171/">https://www.linkedin.com/in/muhan-luo-620259171/</a></p><p>I also am currently working on projects on GitHub, some related to WordPress security, which you can find here: <a href="https://github.com/muhanLuo">https://github.com/muhanLuo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bc2e5917219" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>