# CVE-2017-16820: Use after free in n/a

> A double free vulnerability in the collectd SNMP plugin allows attackers to cause a denial of service via crafted input.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Nov 2017
- **Updated:** 5 Aug 2024
- **Also known as:** ALPINE-CVE-2017-16820, DEBIAN-CVE-2017-16820, GHSA-fh5v-r835-mw7v, RHSA-2018:0252, RHSA-2018:0299, RHSA-2018:0560, RHSA-2018:1605, UBUNTU-CVE-2017-16820

## What is CVE-2017-16820?

CVE-2017-16820 is a critical use after free vulnerability in n/a, published on 14 Nov 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The csnmp_read_table function in snmp.c in the SNMP plugin in collectd before 5.6.3 is susceptible to a double free in a certain error case, which could lead to a crash (or potentially have other impact).

Weakness: CWE-415 (Double Free)

## Which versions are affected by CVE-2017-16820?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `collectd` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-apache` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-ascent` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-bind` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-ceph` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-chrony` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-curl` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-curl_json` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-curl_xml` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-dbi` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-debuginfo` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-disk` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-dns` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-drbd` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-email` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-generic-jmx` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-hugepages` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-ipmi` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-iptables` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-ipvs` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-java` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-log_logstash` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-lvm` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-mysql` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-netlink` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-nginx` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-notify_email` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-openldap` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-ping` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-postgresql` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-rrdcached` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-rrdtool` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-sensors` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-smart` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-snmp` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-turbostat` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-utils` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-virt` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-write_http` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |
| `collectd-write_riemann` | Red Hat:enterprise_linux:7::hypervisor | All versions | 0:5.8.0-3.el7 |

Products: Collectd Collectd.

## How do I fix CVE-2017-16820?

Upgrade to a fixed version.

## Is CVE-2017-16820 being exploited?

There is no known exploitation of CVE-2017-16820 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2016-6254](https://insights.sbomify.com/CVE-2016-6254/): Memory corruption in n/a (critical 9.1)
- [CVE-2017-7401](https://insights.sbomify.com/CVE-2017-7401/): Denial of service in n/a (high 7.5)
- [CVE-2017-18240](https://insights.sbomify.com/CVE-2017-18240/): Privilege escalation in n/a (medium 5.5)
- [CVE-2010-4336](https://insights.sbomify.com/CVE-2010-4336/): Denial of service in n/a (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-16820 and fix it if it is affected.

What it is: CVE-2017-16820 is a critical use after free vulnerability in n/a, published on 14 Nov 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2017-16820 in the wild and no public exploit code.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2017-16820/ (Markdown: https://insights.sbomify.com/CVE-2017-16820/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2017-16820
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2017-16820
- OSV: https://osv.dev/vulnerability/CVE-2017-16820

---
From sbomify Insights: https://insights.sbomify.com/CVE-2017-16820/
Summaries are generated and may contain mistakes; the official description above is the record.
