CVE-2017-16558: Contao/contao SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-w38g-hj45-mjjp
CVSS 9.8
CWE-89
Published
Advisory Summary

CVE-2017-16558 is a CRITICAL (CVSS 9.8) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Contao/contao libraries in the Packagist ecosystem. The issue involves contao sql injection in the backend and listing module. Remediation is available by upgrading affected packages to version 4.4.8.

CVE-2017-16558 at a Glance

CVE Identifier CVE-2017-16558
GHSA Identifier GHSA-w38g-hj45-mjjp
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Contao/contao
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-16558

To remediate this vulnerability, upgrade all affected Contao/contao dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

contao/contao fixed: Latest secure release
Upgrade contao/contao to Latest secure release
contao/contao fixed: 4.4.8
Upgrade contao/contao to 4.4.8
contao/core-bundle fixed: 4.4.8
Upgrade contao/core-bundle to 4.4.8
contao/listing-bundle fixed: 4.4.8
Upgrade contao/listing-bundle to 4.4.8
contao/core-bundle fixed: Latest secure release
Upgrade contao/core-bundle to Latest secure release
contao/listing-bundle fixed: Latest secure release
Upgrade contao/listing-bundle to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for contao/contao

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-16558, inspect your project dependencies for Contao/contao:

inspect dependencies for contao/contao

Analyze the terminal output to locate any version of Contao/contao in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.4.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Contao/contao, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Contao 3.0.0 to 3.5.30 and 4.0.0 to 4.4.7 contains an SQL injection vulnerability in the backend as well as in the listing module.

CVE-2017-16558 Affected Contao/contao Versions

6 component(s)
Fixed Versions:
4.4.8
Product / Package Ecosystem Affected Versions Fixed Version
contao/contao
Packagist
≥ 3.0.0
≤ 3.5.30
contao/contao
Packagist
≥ 4.0.0
< 4.4.8
4.4.8
contao/core-bundle
Packagist
≥ 4.0.0
< 4.4.8
4.4.8
contao/listing-bundle
Packagist
≥ 4.0.0
< 4.4.8
4.4.8
contao/core-bundle
Packagist
≥ 3.0.0
≤ 3.5.30
contao/listing-bundle
Packagist
≥ 3.0.0
≤ 3.5.30

References

Frequently Asked Questions

What is CVE-2017-16558?
CVE-2017-16558 is a security vulnerability in Contao/contao involving Contao SQL injection in the backend and listing module under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Contao/contao versions are affected?
Affected versions include releases prior to 4.4.8 across affected packages: contao/contao, contao/core-bundle, contao/listing-bundle.
What version fixes CVE-2017-16558?
Upgrading to 4.4.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is contao/contao affected?
Yes, contao/contao is affected in releases prior to Latest secure release, 4.4.8. Upgrade your dependency to Latest secure release, 4.4.8 or later.
Is contao/core-bundle affected?
Yes, contao/core-bundle is affected in releases prior to 4.4.8, Latest secure release. Upgrade your dependency to 4.4.8, Latest secure release or later.
What is the CVSS score of CVE-2017-16558?
CVE-2017-16558 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-16558?
CVE-2017-16558 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2017-16558?
Run the dependency tree command: 'inspect dependencies for contao/contao'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w38g-hj45-mjjp",
  "modified" : "2024-04-25T23:08:50Z",
  "published" : "2022-05-24T16:44:36Z",
  "aliases" : [ "CVE-2017-16558" ],
  "summary" : "Contao SQL injection in the backend and listing module",
  "details" : "Contao 3.0.0 to 3.5.30 and 4.0.0 to 4.4.7 contains an SQL injection vulnerability in the backend as well as in the listing module.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/contao"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "last_affected" : "3.5.30"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/contao"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/core-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/listing-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/core-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "last_affected" : "3.5.30"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "contao/listing-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "last_affected" : "3.5.30"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16558"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/commit/501cb3cd34d61089b94e7ed78da53977bc71fc3e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/commit/6b4a2711edf166c85cfd7a53fed6aea56d4f0544"
  }, {
    "type" : "WEB",
    "url" : "https://contao.org/de/changelog/versions/4.4.html"
  }, {
    "type" : "WEB",
    "url" : "https://contao.org/en/news/contao-4_4_8.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/contao/contao/CVE-2017-16558.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/contao/core-bundle/CVE-2017-16558.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/contao/listing-bundle/CVE-2017-16558.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/contao/contao/blob/4.4.57/CHANGELOG.md#448-2017-11-15"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-25T23:08:50Z",
    "nvd_published_at" : "2019-04-25T17:29:00Z"
  }
}