CVE-2016-5397: Github.com/apache/thrift Apache Thrift Go Library Command Vulnerability

HIGH
Advisory Identifier: GHSA-r4m4-pmvw-m6j5
CVSS 8.8
CWE-77
Published
Advisory Summary

CVE-2016-5397 is a HIGH (CVSS 8.8) apache thrift go library command vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Github.com/apache/thrift libraries in the Go ecosystem. The issue involves apache thrift go library command injection. Remediation is available by upgrading affected packages to version 0.10.0.

CVE-2016-5397 at a Glance

CVE Identifier CVE-2016-5397
GHSA Identifier GHSA-r4m4-pmvw-m6j5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Github.com/apache/thrift
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-2016-5397

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

github.com/apache/thrift fixed: 0.10.0
Upgrade github.com/apache/thrift to 0.10.0
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 github.com/apache/thrift

How to Check if You Are Affected

To determine whether your application is affected by CVE-2016-5397, inspect your project dependencies for Github.com/apache/thrift:

inspect dependencies for github.com/apache/thrift

Analyze the terminal output to locate any version of Github.com/apache/thrift in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.0), 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Github.com/apache/thrift, 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 Apache Thrift Go client library exposed the potential during code generation for command injection due to using an external formatting tool. Affected Apache Thrift 0.9.3 and older, Fixed in Apache Thrift 0.10.0.

CVE-2016-5397 Affected Github.com/apache/thrift Versions

1 component(s)
Fixed Versions:
0.10.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/apache/thrift
Go
< 0.10.0
0.10.0

References

Frequently Asked Questions

What is CVE-2016-5397?
CVE-2016-5397 is a security vulnerability in Github.com/apache/thrift involving Apache Thrift Go Library Command Injection under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Github.com/apache/thrift versions are affected?
Affected versions include releases prior to 0.10.0 across affected packages: github.com/apache/thrift.
What version fixes CVE-2016-5397?
Upgrading to 0.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/apache/thrift affected?
Yes, github.com/apache/thrift is affected in releases prior to 0.10.0. Upgrade your dependency to 0.10.0 or later.
What is the CVSS score of CVE-2016-5397?
CVE-2016-5397 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2016-5397?
CVE-2016-5397 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2016-5397?
Run the dependency tree command: 'inspect dependencies for github.com/apache/thrift'. 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-r4m4-pmvw-m6j5",
  "modified" : "2023-07-31T18:21:59Z",
  "published" : "2022-05-13T01:25:56Z",
  "aliases" : [ "CVE-2016-5397" ],
  "summary" : "Apache Thrift Go Library Command Injection",
  "details" : "The Apache Thrift Go client library exposed the potential during code generation for command injection due to using an external formatting tool. Affected Apache Thrift 0.9.3 and older, Fixed in Apache Thrift 0.10.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/apache/thrift"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.10.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.9.3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-5397"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2669"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2019:3140"
  }, {
    "type" : "WEB",
    "url" : "https://issues.apache.org/jira/browse/THRIFT-3893"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4d3f1d3e333d9c2b2f6e6ae8ed8750d4de03410ac294bcd12c7eefa3@%3Ccommits.cassandra.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210124141102/http://www.securityfocus.com/bid/103025"
  }, {
    "type" : "WEB",
    "url" : "http://mail-archives.apache.org/mod_mbox/thrift-user/201701.mbox/raw/%3CCANyrgvc3W%3DMJ9S-hMZecPNzxkyfgNmuSgVfW2hdDSz5ke%2BOPhQ%40mail.gmail.com%3E"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-31T18:21:59Z",
    "nvd_published_at" : "2018-02-12T17:29:00Z"
  }
}