CVE-2020-15143: Sylius/resource bundle Remote Code Execution Vulnerability
HIGHCVE-2020-15143 is a HIGH (CVSS 7.7) remote code execution vulnerability (CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')) affecting Sylius/resource bundle libraries in the Packagist ecosystem. The issue involves remote code execution in syliusresourcebundle. Remediation is available by upgrading affected packages to version 1.4.7, 1.5.2, 1.6.4, 1.3.14.
CVE-2020-15143 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N).
How to Fix CVE-2020-15143
To remediate this vulnerability, upgrade all affected Sylius/resource bundle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade sylius/resource-bundle to 1.4.7
Upgrade sylius/resource-bundle to 1.5.2
Upgrade sylius/resource-bundle to 1.6.4
Upgrade sylius/resource-bundle to 1.3.14
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sylius/resource-bundle
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-15143, inspect your project dependencies for Sylius/resource bundle:
inspect dependencies for sylius/resource-bundle
Analyze the terminal output to locate any version of Sylius/resource bundle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.7), 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-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection'), where the product constructs all or part of an expression language (el) statement in a framework such as a java server page (jsp) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended el statement before it is executed. In Sylius/resource bundle, 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
CVE-2020-15143 Affected Sylius/resource bundle Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sylius/resource-bundle
|
Packagist |
≥ 1.4.0
< 1.4.7
|
1.4.7
|
|
sylius/resource-bundle
|
Packagist |
≥ 1.5.0
< 1.5.2
|
1.5.2
|
|
sylius/resource-bundle
|
Packagist |
≥ 1.6.0
< 1.6.4
|
1.6.4
|
|
sylius/resource-bundle
|
Packagist |
≥ 1.0.0
< 1.3.14
|
1.3.14
|
References
Frequently Asked Questions
What is CVE-2020-15143?
Which Sylius/resource bundle versions are affected?
What version fixes CVE-2020-15143?
Is sylius/resource-bundle affected?
What is the CVSS score of CVE-2020-15143?
What CWE is associated with CVE-2020-15143?
How can I check Packagist dependencies for CVE-2020-15143?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p4pj-9g59-4ppv",
"modified" : "2021-11-19T15:41:13Z",
"published" : "2020-08-19T21:04:25Z",
"aliases" : [ "CVE-2020-15143" ],
"summary" : "Remote Code Execution in SyliusResourceBundle",
"details" : "### Impact\n\nRequest parameters injected inside an expression evaluated by `symfony/expression-language` package haven't been sanitized properly. This allows the attacker to access any public service by manipulating that request parameter, allowing for Remote Code Execution.\n\nThe vulnerable versions include: `<=1.3.13 || >=1.4.0 <=1.4.6 || >=1.5.0 <=1.5.1 || >=1.6.0 <=1.6.3`.\n\n### Example\n\n```yaml\nfoo:\n path: /foo/{id}\n defaults:\n _sylius:\n repository:\n method: findSome\n arguments:\n entity: \"expr:service('repository').find($id)\"\n```\n\nIn this case, `$id` can be prepared in a way that calls other services. \n\nIf you visit `/foo/\"~service('doctrine').getManager().getConnection().executeQuery(\"DELETE * FROM TABLE\")~\"`, it will result in a following expression `expr:service('repository').find(\"\"~service('doctrine').getManager().getConnection().executeQuery(\"DELETE * FROM TABLE\")~\"\")`, which will execute a query on the currently connected database.\n\nTo find a vulnerability in your application, look for any routing definition that uses request parameters inside expression language.\n\n### Patches\n\nThis issue has been patched for versions 1.3.14, 1.4.7, 1.5.2 and 1.6.4. Versions prior to 1.3 were not patched.\n\n### Workarounds\n\nThe fix requires adding `addslashes` in `ParametersParser::parseRequestValueExpression` to sanitize user input before evaluating it using the expression language.\n\n```php\n- return is_string($variable) ? sprintf('\"%s\"', $variable) : $variable;\n+ return is_string($variable) ? sprintf('\"%s\"', addslashes($variable)) : $variable;\n```\n\n### Acknowledgements\n\nThis security issue has been reported by Craig Blanchette (@isometriks), thanks a lot!\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Email us at [security@sylius.com](mailto:security@sylius.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/resource-bundle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.4.0"
}, {
"fixed" : "1.4.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/resource-bundle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.5.0"
}, {
"fixed" : "1.5.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/resource-bundle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.6.0"
}, {
"fixed" : "1.6.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sylius/resource-bundle"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.3.14"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Sylius/SyliusResourceBundle/security/advisories/GHSA-p4pj-9g59-4ppv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15143"
}, {
"type" : "WEB",
"url" : "https://github.com/Sylius/SyliusResourceBundle/commit/73ed8b8bb083f36c30ad7c3cec336f65d6a80650"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/sylius/resource-bundle/CVE-2020-15143.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Sylius/SyliusResourceBundle"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-917" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-19T20:30:42Z",
"nvd_published_at" : "2020-08-20T01:17:00Z"
}
}