• Resolved shawnz28

    (@shawnz28)


    Out most recent scans run my our credit card processor is coming back with some errors I have not gotten in the past. I have been able to take care of some of them but I am getting a few Boolean Based SQL Injection Vulnerability. I am rather green into what I am looking at but looking at the report it appears it is getting errors on quantity or another selectable attribute on the product page.

    I have been trying to research but I am really not getting far in how to try to figure out what plugin for example (if that is the cause) might be the reason for these. Is there anything specific I should be looking for?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi Shawn,

    It’s great that you are proactively addressing these concerns, and I understand that identifying the source can feel a bit overwhelming, especially if you’re new to this.

    Out of curiousity, could you share a screenshot of flag? Have you already tried reproducing the issue manually? For example, by appending the scanner’s payloads to the product URL and observing whether the page output changes. Is your WooCommerce store using any custom product‑page plugins or custom code? Some plugins modify how attributes or quantities are validated, which can influence scanner behavior.

    To help pinpoint the cause, you’ll want to focus on any plugins or custom code that interacts with product attributes like quantity or selectable options on your product pages. Here are a few steps and tips to guide your investigation:

    • Review any plugins or themes that have recently been added or updated before you noticed the vulnerability. Sometimes new or updated code can introduce unexpected issues.
    • Focus on plugins that manage product variations, quantity selectors, or custom fields on product pages. Many extensions that add complex product options or filters might be involved.
    • If possible, temporarily disable plugins related to product options one by one and rerun the scan (in a staging environment) to see if the vulnerability persists. This can help isolate the problematic plugin.
    • If your site uses any custom PHP code or code snippets related to quantity or product attributes, check for proper sanitization and validation of input before database queries. Unsanitized input is a common cause of SQL injection.
    • Ensure that WooCommerce, your theme, and all plugins are updated to their latest versions, as updates often patch vulnerabilities.

    I hope that helps. Let us know if you need anything else.

    Thread Starter shawnz28

    (@shawnz28)

    Thank you for the response. I didn’t want to initially paste or share the URL as was concerned for reputation but let me attach a doc with the error output, I can remove it later.

    boolean.txt – my username is the pw

    I am not sure how to try appending or replicating as mentioned. As for plugins I do not think there is any plugin or code that does anything with the product options and if so nothing that has been changed in a couple years. The only real change in last year or so was changing the theme to Woodmart but that was done prior to previous scans.

    I ran most all my updates including woo, wordpress, theme and theme patches etc but I do have two shipping plugins that are out of date…. Has been a chance we go a different route with the site so have delayed investing in updating these two. One of the two I don’t think we actually need and both looking at the change log I did not see anything that stood out as being the culprit. One of the two I did deactivate and rerun with no change to the errors.

    On top of the Boolean error I am also trying to chase down one other non compliant and other not so critical errors like Insecure configuration of Cookie attributes and Full Path Disclosure. I have tried adding the below to my htaaccess and php but have not seemed to help

    # Add Secure + HttpOnly to any cookies (if not already present) Header always edit Set-Cookie ^(.*)$ “$1; Secure; HttpOnly”

    php_admin_flag[session.cookie_secure] = on
    php_admin_flag[session.cookie_httponly] = on
    php_admin_value[session.cookie_samesite] = Lax
    php_admin_flag[display_errors] = off
    php_admin_value[display_errors]=off

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @shawnz28,

    Thank you for sharing the scan output, I completely understand wanting to be cautious while also getting to the bottom of this. You are doing the right thing by digging into the details.

    Looking at the report you shared , the scanner is posting a manipulated value to the quantity field on a product page and detecting a different response between a true and false SQL condition. Specifically, it is sending payloads like: 1' or '4202'='4202 to the quantity field via POST, and interpreting the different responses as a Boolean based SQL injection vulnerability.

    A few important clarifications here:
    WooCommerce does not use the raw quantity POST value directly in SQL queries. Quantities are sanitized, cast to integers, and validated before being processed. In many cases, PCI scanners flag dynamic response differences as SQL injection even when the application is safely handling the input. A 200 OK response alone does not confirm a real exploitable SQL injection.

    Here is how I recommend proceeding:
    First, confirm whether this is a false positive. On a staging site, try manually submitting a clearly invalid quantity like: 1' OR 1=1

    If the product page simply reloads, resets the quantity, or ignores the input without exposing database errors or unexpected data, that is a strong indication that this is not a real SQL injection, but scanner behavior detection.

    Second, temporarily switch your theme from Woodmart to a default theme like Storefront or Twenty Twenty Four and retest. Since Woodmart modifies quantity UI and product templates, this helps rule out theme level customization.

    Third, perform a full plugin conflict test. Deactivate all plugins except WooCommerce, then retest. If the issue disappears, reactivate plugins one by one to isolate the cause. You mentioned outdated shipping plugins, those would definitely be worth including in this process even if their changelogs do not mention security fixes.

    If after isolating everything, the behavior still occurs with only WooCommerce active and a default theme, please share your full System Status Report via https://pastebin.com or https://gist.github.com so we can review your environment configuration more closely.

    Regarding the cookie flags and path disclosure items, adding headers in .htaccess does not always override how WordPress or PHP sets cookies. WooCommerce already sets Secure and HttpOnly on its cookies when the site is fully HTTPS, which your report shows in the response headers. For PHP session settings, those typically need to be enforced at the server or php.ini level rather than .htaccess, depending on hosting configuration. If you are on managed hosting, it may require their assistance.

    At this stage, the most likely scenarios are either a false positive from the scanner or a third party plugin or theme customization interacting with quantity handling. Let us narrow it down systematically and we will get clarity.

    Once you have tested with a default theme and minimal plugins, let me know the outcome and we can take the next step together.

    Thread Starter shawnz28

    (@shawnz28)

    You have given me alot to chew on so will definitely take me some time to get back to this with all the “answers”.

    For point 1, I am not sure how I would do this as the input field wont accept that of course so must me another method i will need to research.

    Sounds like step 2 might be the easiest check, the site would not be pretty for a bit but could do this overnight even on the live site.

    I need to look into how to do a staging site again. I had one before pointed to a subdomain which I ended up deleting while back as was no longer nearly in sync with the live. But the other issue I had was google etc was crawling it and I had to password protect it as it was getting found in search and had customers attempting to place orders etc. I locked it down with a pw but to do the PCI scan I would need to open it temporarily i assume once I create it?

    On the last note on the cookie and path disclosure I did add only the one item to the HTAaccess the other 5 lines were added to the PHP FPM

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thanks for the detailed follow-up I appreciate you taking the time to walk through this.

    To clarify point 1: you don’t need to force invalid characters directly into the quantity input field via the browser UI. The scanner is submitting those payloads programmatically via a POST request, which is why it’s able to bypass normal front-end restrictions. The goal of that step is simply to confirm whether WooCommerce safely handles unexpected input (which it generally does) and whether any actual SQL errors or data exposure occur not necessarily to replicate the exact scanner behavior manually.

    You’re right that point 2 is the easiest initial test. Temporarily switching to a default theme (such as Twenty Twenty-Four or Storefront) is a reasonable overnight check and helps rule out theme-level customizations affecting request handling.

    Regarding staging: for PCI scanning, a staging site is strongly recommended. Password protection is fine during normal use, but you would indeed need to temporarily remove it while running the scan. To avoid indexing and customer access, you can:

    • Add a noindex directive,
    • Block crawlers via robots.txt,
    • Or restrict access by IP rather than basic auth, if your host allows it.

    That keeps the environment safe while still allowing the scanner to function.

    On the cookie and path disclosure notes thanks for clarifying. Since some settings are being enforced at the PHP-FPM/server level, that aligns with what we typically see. From a WooCommerce perspective, when the site is fully HTTPS, WooCommerce core already sets Secure and HttpOnly flags on its cookies, and anything beyond that is usually host- or server-specific.

    At this stage, from a WooCommerce core support standpoint, the most important next step is still isolating whether this behavior occurs:

    • With a default theme, and
    • With only WooCommerce active.

    If the scanner results persist under those conditions, please share a fresh System Status Report so we can review the environment configuration further. Otherwise, it would indicate the issue is coming from a third-party theme, plugin, or server-level configuration, which would be outside WooCommerce core.

    Take your time working through the checks, and feel free to update us as you go we’ll take it step by step.

    Thread Starter shawnz28

    (@shawnz28)

    I will come back to this it will likely take me a few days at least but I wanted to thank all three of you for the extremely detailed responses.

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @shawnz28,

    Please feel free to take the time you need to test on staging, switch themes, or run through the plugin checks we discussed. There is no rush from our side. When you are ready and have new findings, just drop an update here and we will gladly continue working through it with you. Looking forward to hearing back from you when you are ready.

    Thread Starter shawnz28

    (@shawnz28)

    So i ran the scan disabling Woodmart theme and enabling TwentyFour.

    After running the scan with the default theme all the Boolean Based SQL Injection Vulnerability and the non compliant Insecure configuration of Cookie attributes are gone so appears that is the problem and I would assume I need to go to the author to correct this.

    I did get a new error I did not have before for Misconfigured HTTP Caching though I am guessing that may not be woocommerce related itself.

    I still have many errors that while they are PCI compliant would love to try to work thru, some may not be correctable and “normal” I am not sure yet others like the Full Path Disclosure would like to try to find a solution.

    • This reply was modified 1 month, 1 week ago by shawnz28.
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there,

    Thank you for running that test with the default theme that was exactly the right troubleshooting step.

    Since the SQL Injection warnings and cookie attribute issues disappear when switching from Woodmart to Twenty Twenty-Four, that strongly indicates the issue is theme-related. In this case, contacting the theme author is the correct next step, as theme-level vulnerabilities fall outside WooCommerce core support.

    Regarding the “Misconfigured HTTP Caching” Warning

    You’re correct — this is generally not WooCommerce-specific.

    This type of warning is usually related to:

    • Server configuration
    • Caching plugins (e.g. W3 Total Cache)
    • CDN settings
    • Cache headers

    It’s rarely caused by WooCommerce core itself. You may want to temporarily disable your caching plugin and re-run the scan to confirm whether that changes the result.

    Regarding the remaining warnings, many automated PCI/security scans flag items that are informational, hosting-level, or related to server configuration rather than WooCommerce itself.

    Since these items involve HTTP caching, cookie attributes, or potential path disclosure, I recommend contacting your hosting provider. They can review:

    • Server header configuration
    • PHP error display settings
    • Cache rules
    • Security modules (e.g., ModSecurity)
    • SSL/TLS configuration

    These settings are controlled at the server level and are outside WooCommerce core functionality.

    Before you go, If you found WooCommerce helpful in setting up your store, we would really appreciate it if you could leave a five-star review:https://ww.wp.xz.cn/support/plugin/woocommerce-paypal-payments/#new-topic-0. Your feedback helps us improve and lets other users know how WooCommerce can support their business.

    Thread Starter shawnz28

    (@shawnz28)

    XTemos got back to me, they had me shut off all the plugins and give them access and after they checked they told me the following…

    We are trying to understand and reproduce the first issue about Boolean-based SQL Injection but we don’t see anything wrong with the theme there. The document states that two specific POST requests return different HTML and provides both examples. We compared them and see no difference. As well as no signs of any SQL vulnerability. Moreover, this functionality is related to the WooCommerce plugin and not to the theme.
    Note that the Related products part of the page is generated randomly and it may give different HTML for different POST requests https://gyazo.com/b99729cdb7a7143d8f0d2e4cda6b9eb9
    Maybe you need to test for this when the Related products are turned off.

    I dont know if my rational agrees with the above since related products would be there with and without the theme I assume. That said to test this I found this on how to disable or hide this feature…. would one be better than the other if so? https://woocommerce.com/document/remove-related-posts-output/

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @shawnz28,

    Thank you for sharing the update and for continuing to dig into this with both the theme developers and the tests you ran. It is great to see the methodical troubleshooting you have already done.

    Since the scan warnings disappeared when switching from Woodmart to a default theme, that test result is still an important indicator. It tells us that the behavior detected by the scanner is influenced by how the theme renders the product page output.

    What the theme developers mentioned about related products generating different HTML is technically possible. Related products in WooCommerce can be randomized, which means the HTML output can vary between requests. Some security scanners interpret any difference in response content as evidence of a Boolean based SQL injection, even when the difference is unrelated to database queries.

    Because of that, temporarily disabling related products is a reasonable test to run. Either approach mentioned in the guide works, but the safest and most reliable method is using the code snippet that removes the related products output, since it completely prevents that section from rendering during the scan.

    You can follow the guide here: https://woocommerce.com/document/remove-related-posts-output/

    After disabling related products, I recommend running the PCI scan again and comparing the results. If the warnings disappear, that would strongly suggest the scanner was reacting to dynamic page output rather than a real SQL injection vulnerability.

    Regarding the other warning you mentioned, Misconfigured HTTP Caching, that is typically controlled by server headers, caching plugins, or CDN configuration rather than WooCommerce itself. Your hosting provider or caching plugin documentation will usually be the best place to review those settings.

    Please let us know what the results look like after testing with related products disabled and we will gladly continue working through it with you.

    Plugin Support Kay U a11n

    (@kingsleyinfo)

    It seems we haven’t heard back from you for a while, so I’ll go ahead and mark this thread as resolved. Feel free to reach out whenever you’re ready to continue.

    We’d love your feedback – please leave us a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

Viewing 12 replies - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.