# CVE-2023-31129: Contiki-NG missing NULL pointer check in IPv6 neighbor discovery

> Attackers can cause a denial of service in Contiki-NG by sending crafted IPv6 Router Solicitation messages that trigger a NULL pointer dereference.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 8 May 2023
- **Updated:** 29 Jan 2025
- **Also known as:** GHSA-x29r-5qjg-75mq

## What is CVE-2023-31129?

CVE-2023-31129 is a high-severity vulnerability in contiki-ng, published on 8 May 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The Contiki-NG operating system versions 4.8 and prior can be triggered to dereference a NULL pointer in the message handling code for IPv6 router solicitiations. Contiki-NG contains an implementation of IPv6 Neighbor Discovery (ND) in the module `os/net/ipv6/uip-nd6.c`. The ND protocol includes a message type called Router Solicitation (RS), which is used to locate routers and update their address information via the SLLAO (Source Link-Layer Address Option). If the indicated source address changes, a given neighbor entry is set to the STALE state.

The message handler does not check for RS messages with an SLLAO that indicates a link-layer address change that a neighbor entry can actually be created for the indicated address. The resulting pointer is used without a check, leading to the dereference of a NULL pointer of type `uip_ds6_nbr_t`.

The problem has been patched in the `develop` branch of Contiki-NG, and will be included in the upcoming 4.9 release. As a workaround, users can apply Contiki-NG pull request #2271 to patch the problem directly.

Weakness: CWE-476 (NULL Pointer Dereference)

## Which versions are affected by CVE-2023-31129?

It affects 1 product.


Products: Contiki-Ng Contiki-Ng.

## How do I fix CVE-2023-31129?

No fix has been published for CVE-2023-31129 yet. Limit exposure of the affected software until one is available.

## Is CVE-2023-31129 being exploited?

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

## Other vulnerabilities in contiki-ng

- [CVE-2018-19417](https://insights.sbomify.com/CVE-2018-19417/): Memory corruption in n/a (critical 10.0)
- [CVE-2023-30546](https://insights.sbomify.com/CVE-2023-30546/): Contiki-NG has off-by-one error in Antelope DBMS (critical 9.8)
- [CVE-2020-24336](https://insights.sbomify.com/CVE-2020-24336/): Memory corruption in n/a (critical 9.8)
- [CVE-2020-14934](https://insights.sbomify.com/CVE-2020-14934/): Memory corruption in n/a (critical 9.8)
- [CVE-2020-14935](https://insights.sbomify.com/CVE-2020-14935/): Memory corruption in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-31129 and fix it if it is affected.

What it is: CVE-2023-31129 is a high-severity vulnerability in contiki-ng, published on 8 May 2023. 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-2023-31129 in the wild and no public exploit code.

Affected product: contiki-ng. 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-2023-31129/ (Markdown: https://insights.sbomify.com/CVE-2023-31129/index.md)
```

## Sources

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

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