nuts-foundation / nuts-foundation/nuts-node

NTS-002: Sensitive Data Is Not mlocked

Open
#1,717 5 comments 0 reactions 1 assignee View on GitHub

@reinkrul is already working on this.

Since Dec 8, 2022.

fba
Dominant language
Go
Stars
28
Forks
23
Avg merge
1d 10h
Merged PRs (30d)
76

Description

Description
Secret keys might be written to disk and escape sanitization when memory is swapped out.

Technical description:
It might be possible for a local attacker to exhaust memory while sensitive key-material is in use in RAM. Since keys are not protected with mlock() , these keys might be swapped out to disk and thus may leak. Unfortunately these keys written to disk will not be sanitized on disk when they are wiped after usage.

Impact:
Private keys may be swapped to disk and exfiltrated by an attacker-controlled process on the same machine.

Recommendation:
Our recommendation is to use mlock() on any sensitive key-material prohibiting these to be written to disk, or alternatively consider a generic solution like https://github.com/awnumar/memguard .

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.