Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This gem can be used to setup a quick local api server.
Add this line to your application's Gemfile:
gem 'scenario_server'
Or manually install it:
$ gem install scenario_server
A yaml file when provided at the following location
~/.scenarios/config.yml
can be used to define the port and path of the sqlite database holding the routes. If this file is not provided, the db file is created wherever the ruby gem is installed.
localport: 4567 localdbfile: /Users/vaibhav/.scenarios/scenarios.sqlite3
The server can be started in daemon mode by
scenario_service start
or without a daemon mode
scenario_service start -t
Scenarios is a context in which you are using your local api server. Each scenario contains one or more routes.
e.g.
#####Default
#####Rainy
#####Error
Scenarios are usually broken up as:
On startup, all responses returned from the server are from default scenario.
Make a request with scenario server url and path of the route with the correct request type. Also specify header SCENE with your scenario name, This will return the fixture under that scenario, with status code and headers specified e.g.
curl -X GET -H "SCENE:rainy" http://localhost:4567/v1/season
If the header SCENE is not present, the current scenario set on the server would be used.
will return
{"name":"rainy","temperature":50,"precipitation":5}
curl http://localhost:4567/scenarios
or point the browser to http://localhost:4567/scenarios
curl http://localhost:4567/scenario
or point the browser to http://localhost:4567/scenario
curl -X PUT http://localhost:4567/scenario/rainy -d ''
Note: If you are not in 'default' scenario and make a call to a route which is not defined, server will also check 'default' for that route. If present, it will return data from that route else will give a 404.
curl -X POST http://localhost:4567/scenarios/new -d 'winter'
or point the browser to http://localhost:4567/scenarios and add name in the text box below New scenario and then click submit.
Given that winter scenario has an id 3
curl -X DELETE http://localhost:4567/scenarios/3
Given that 'rainy' scenario has an id 2
curl http://localhost:4567/scenarios/2/routes
FAQs
Unknown package
We found that scenario_server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.