GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Internal domain function can be used to cause segfaults · Issue #14519 · nodejs/node

Internal domain function can be used to cause segfaults #14519

New issue
Copy link
New issue
Copy link
Closed
Closed
Internal domain function can be used to cause segfaults#14519
Copy link
Labels
domainIssues and PRs related to the domain subsystem.Issues and PRs related to the domain subsystem.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.

Description

@tniessen
tniessen
opened on Jul 27, 2017
Issue body actions
  • Version: master
  • Platform: all
  • Subsystem: process / domain

The following snippet will cause a segmentation fault on master:

// This is an evil array
const array = [0];
Object.defineProperty(array, '0', {
  get() {
    throw new Error();
  }
});

// Trick the environment into thinking it is inside a domain
process._setupDomainUse(array, [])[0] = 1;

// This call will try to use the pretended domain and segfault
require('crypto').randomBytes(1024, () => { });

// The process will segfault above so this never gets printed
console.log('Still working');

This is caused by using env->domain_array->Get(0) instead of the safe variant of the Get function. This is not limited to randomBytes, there is a number of files with similar code.

The priority of this issue is very low as it uses undocumented internal functions to intentionally cause a segmentation fault. I am documenting this for the sake of completeness.

Activity

  1. tniessen
    added
    domainIssues and PRs related to the domain subsystem.Issues and PRs related to the domain subsystem.
    processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
    on Jul 27, 2017
  2. tniessen
    closed this as completedin 1c36243on Aug 2, 2017
  3. addaleax
    added a commit that references this issue on Aug 2, 2017

    crypto: change segmentation faults to CHECKs

    51c1afa
  4. sjarmak
    added a commit that references this issue on Jul 27, 2026

    crypto: change segmentation faults to CHECKs

    1c36243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domainIssues and PRs related to the domain subsystem.Issues and PRs related to the domain subsystem.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.