CVE-2017-1000053: Plug Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-5v4m-c73v-c7gq
CVSS 8.1
CWE-502
Published
Advisory Summary

CVE-2017-1000053 is a HIGH (CVSS 8.1) arbitrary code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Plug libraries in the Hex ecosystem. The issue involves arbitrary code execution in cookie serialization. Remediation is available by upgrading affected packages to version 1.0.4, 1.1.7, 1.2.3, 1.3.2.

CVE-2017-1000053 at a Glance

CVE Identifier CVE-2017-1000053
GHSA Identifier GHSA-5v4m-c73v-c7gq
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Plug
Package Ecosystem Hex
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
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-1000053

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.

plug fixed: 1.0.4
Upgrade plug to 1.0.4
plug fixed: 1.1.7
Upgrade plug to 1.1.7
plug fixed: 1.2.3
Upgrade plug to 1.2.3
plug fixed: 1.3.2
Upgrade plug to 1.3.2
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 plug

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-1000053, 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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

The default serialization used by Plug session may result in code execution in certain situations. Keep in mind, however, the session cookie is signed and this attack can only be exploited if the attacker has access to your secret key as well as your signing/encryption salts. We recommend users to change their secret key base and salts if they suspect they have been leaked, regardless of this vulnerability.

CVE-2017-1000053 Affected Plug Versions

4 component(s)
Fixed Versions:
1.0.41.1.71.2.31.3.2
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-1000053?
CVE-2017-1000053 is a security vulnerability in Plug involving Arbitrary Code Execution in Cookie Serialization under CWE-502: Deserialization of Untrusted Data.
Which Plug versions are affected?
Affected versions include releases prior to 1.0.4, 1.1.7, 1.2.3, 1.3.2 across affected packages: plug.
What version fixes CVE-2017-1000053?
Upgrading to 1.0.4, 1.1.7, 1.2.3, 1.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is plug affected?
Yes, plug is affected in releases prior to 1.0.4, 1.1.7, 1.2.3, 1.3.2. Upgrade your dependency to 1.0.4, 1.1.7, 1.2.3, 1.3.2 or later.
What is the CVSS score of CVE-2017-1000053?
CVE-2017-1000053 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-1000053?
CVE-2017-1000053 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Hex dependencies for CVE-2017-1000053?
Run the dependency tree command: 'inspect dependencies for plug'. 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-5v4m-c73v-c7gq",
  "modified" : "2022-04-12T21:23:43Z",
  "published" : "2022-04-12T21:23:43Z",
  "aliases" : [ "CVE-2017-1000053" ],
  "summary" : "Arbitrary Code Execution in Cookie Serialization",
  "details" : "The default serialization used by Plug session may result in code execution\n  in certain situations. Keep in mind, however, the session cookie is signed\n  and this attack can only be exploited if the attacker has access to your\n  secret key as well as your signing/encryption salts. We recommend users to\n  change their secret key base and salts if they suspect they have been leaked,\n  regardless of this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/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-1000053"
  }, {
    "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-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-12T21:23:43Z",
    "nvd_published_at" : null
  }
}