CVE-2017-1000052: Plug Null Byte Injection Vulnerability
HIGHCVE-2017-1000052 is a HIGH (CVSS 7.8) null byte injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Plug libraries in the Hex ecosystem. The issue involves null byte injection in plug.static. Remediation is available by upgrading affected packages to version 1.0.4, 1.1.7, 1.2.3, 1.3.2.
CVE-2017-1000052 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2017-1000052
To remediate this vulnerability, upgrade all affected Plug 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 plug to 1.0.4
Upgrade plug to 1.1.7
Upgrade plug to 1.2.3
Upgrade plug to 1.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for plug
How to Check if You Are Affected
To determine whether your application is affected by CVE-2017-1000052, inspect your project dependencies for Plug:
inspect dependencies for plug
Analyze the terminal output to locate any version of Plug in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.4), 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Plug, 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-2017-1000052 Affected Plug Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
plug
|
Hex |
< 1.0.4
|
1.0.4
|
|
plug
|
Hex |
≥ 1.1.0
< 1.1.7
|
1.1.7
|
|
plug
|
Hex |
≥ 1.2.0
< 1.2.3
|
1.2.3
|
|
plug
|
Hex |
≥ 1.3.0
< 1.3.2
|
1.3.2
|
References
Frequently Asked Questions
What is CVE-2017-1000052?
Which Plug versions are affected?
What version fixes CVE-2017-1000052?
Is plug affected?
What is the CVSS score of CVE-2017-1000052?
What CWE is associated with CVE-2017-1000052?
How can I check Hex dependencies for CVE-2017-1000052?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2q6v-32mr-8p8x",
"modified" : "2022-04-12T21:20:20Z",
"published" : "2022-04-12T21:20:20Z",
"aliases" : [ "CVE-2017-1000052" ],
"summary" : "Null Byte Injection in Plug.Static",
"details" : "Plug.Static is used for serving static assets, and is vulnerable to null\n byte injection. If file upload functionality is provided, this can allow\n users to bypass filetype restrictions.\n We recommend all applications that provide file upload functionality and\n serve those uploaded files locally with Plug.Static to upgrade immediately\n or include the fix below. If uploaded files are rather stored and served\n from S3 or any other cloud storage, you are not affected.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Hex",
"name" : "plug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Hex",
"name" : "plug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.1.0"
}, {
"fixed" : "1.1.7"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Hex",
"name" : "plug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.2.0"
}, {
"fixed" : "1.2.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Hex",
"name" : "plug"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.0"
}, {
"fixed" : "1.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1000052"
}, {
"type" : "WEB",
"url" : "https://elixirforum.com/t/security-releases-for-plug/3913"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/elixir-plug/plug"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-12T21:20:20Z",
"nvd_published_at" : null
}
}