CVE-2016-5397
Description
Apache Thrift Go client library command injection via gofmt during code generation; affects versions prior to 0.10.0.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Apache Thrift Go client library command injection via gofmt during code generation; affects versions prior to 0.10.0.
Vulnerability
The Apache Thrift Go client library, versions 0.9.3 and earlier, is vulnerable to command injection during code generation due to improper sanitization of file paths in t_go_generator.cc:format_go_output(), which uses an external formatting tool (gofmt). [1][4]
Exploitation
An attacker who can control the service name provided to a Thrift code generator (e.g., via malicious input to a framework invoking Thrift) can inject arbitrary commands. The service name is used to construct a file path that is passed to gofmt, resulting in command injection. [4]
Impact
Successful exploitation allows an attacker to execute arbitrary commands on the machine running the Thrift code generator. This can lead to full compromise of the build or development environment. [1][4]
Mitigation
The vulnerability is fixed in Apache Thrift version 0.10.0, released in December 2016. Users should upgrade to 0.10.0 or later. Red Hat issued patches in RHSA-2018:2669 for Fuse 7.1 and RHSA-2019:3140 for JBoss Data Virtualization 6.4.8. [2][3][4]
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/apache/thriftGo | < 0.10.0 | 0.10.0 |
Affected products
5- osv-coords4 versionspkg:apk/chainguard/cadencepkg:apk/chainguard/cadence-cassandra-toolpkg:apk/chainguard/cadence-fipspkg:golang/github.com/apache/thrift
< 1.4.0-r3+ 3 more
- (no CPE)range: < 1.4.0-r3
- (no CPE)range: < 1.4.0-r3
- (no CPE)range: < 1.4.0-r3
- (no CPE)range: < 0.10.0
- Apache Software Foundation/Apache Thriftv5Range: versions prior to 0.10.0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
10- access.redhat.com/errata/RHSA-2018:2669ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2019:3140ghsavendor-advisoryx_refsource_REDHATWEB
- github.com/advisories/GHSA-r4m4-pmvw-m6j5ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2016-5397ghsaADVISORY
- mail-archives.apache.org/mod_mbox/thrift-user/201701.mbox/raw/%3CCANyrgvc3W%3DMJ9S-hMZecPNzxkyfgNmuSgVfW2hdDSz5ke%2BOPhQ%40mail.gmail.com%3Eghsamailing-listx_refsource_MLISTWEB
- www.securityfocus.com/bid/103025mitrevdb-entryx_refsource_BID
- issues.apache.org/jira/browse/THRIFT-3893ghsax_refsource_CONFIRMWEB
- lists.apache.org/thread.html/r4d3f1d3e333d9c2b2f6e6ae8ed8750d4de03410ac294bcd12c7eefa3%40%3Ccommits.cassandra.apache.org%3Emitremailing-listx_refsource_MLIST
- lists.apache.org/thread.html/r4d3f1d3e333d9c2b2f6e6ae8ed8750d4de03410ac294bcd12c7eefa3@%3Ccommits.cassandra.apache.org%3EghsaWEB
- web.archive.org/web/20210124141102/http://www.securityfocus.com/bid/103025ghsaWEB
News mentions
0No linked articles in our index yet.