WebAssembly / WebAssembly/wasi-libc

Integer overflow in setenv

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1k
Forks
251
Avg merge
7h 15m
Merged PRs (30d)
3

Description

This code could lead to integer overflow into malloc. In its turn with subsequent memcpy it could lead to heap overflow. Hypothetically it could affect users. If it is matter, I can make a PR.

P.S. Also it is interested are such cases matter in general? Are there any policy to or not to mitigate them? I can imagine situations when users could be affected of this behaviour, but don't know any real examples.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading libc-top-half/musl/src/env/setenv.c at the linked line and tracing the surrounding allocation and copy path. Check the existing environment-related tests and project policy for integer-overflow fixes; done means the reported overflow risk is addressed or explicitly ruled out with regression coverage where appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, wasm
Domain
operating-systems, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.