GithubHelp home page GithubHelp logo

node-ipc-goof's Introduction

Take a look at the blog post published on this: Alert: peacenotwar module sabotages npm developers in the node-ipc package to protest the invasion of Ukraine

This is a benign version of the very malicious attempt to delete files if the machine running the code was in Russia or Belarus.

The issue was documented here and quickly acted upon to prevent damage.

NOTE: Every precaution has been taken to make this code non-destructive. Use at your own risk. It's advised that you only run this code inside a container.

Set up in Docker

docker build . -t node-ipc-goof
docker run --rm --name node-ipc-goof node-ipc-goof

Run the example in Docker

docker exec -it node-ipc-goof /bin/bash

Then:

node index.js

You'll see output like:

geo ip request url::
	https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154
current path:
	./
up one:
	../
up two:
	../../
root:
	/
key from geo ip response to look for:
	country_name
country name to act on:
	russia
country name to act on:
	belarus
json passed into function:
	{"country_name":"russia"}
the country name in the json is one we care about:
	true
the character that will be used to overwrite all files:
	❤️
file to be overwritten:
	.dccache
file to be overwritten:
	Dockerfile
file to be overwritten:
	index.js
file to be overwritten:
	package.json

The modified code does not make an api call to ipgeolocation.io.

It also does NOT overwrite any files.

An effort was made to preserve the original code with minimal changes. Lines that performed the api calls and did destructive actions have been commented out.

node-ipc-goof's People

Contributors

mathiasconradt avatar dogeared avatar

Forkers

sbsnyk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.