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.
github.com/youngderekm/grpc-cookies-example
This code demonstrates how to make gRPC calls create and/or delete session cookies in the gRPC json gateway. This makes it possible, for example, to setup a session on successful login from a signin call and then delete that session on a signout call. The gRPC server doesn't have access to the HTTP request or response, but can set metadata flags that custom HTTP and gPRC middleware in the gateway can react to.
To compile/build:
go build ./cmd/grpc
go build ./cmd/gateway
To regenerate code from the gRPC .proto file (only necessary if servicedef.proto has been changed):
cd servicedef
go generate
The protoc compiler is run under docker to regenerate these servicedef.pb.go
and servicedef.pb.gw.go
.
To run:
# in one tab:
./grpc
# in another tab
./gateway
To test:
curl -v --header "Content-Type: application/json" \
--request POST \
--data '{"username":"tester","password":"1234"}' \
http://localhost:8081/v1/authapi/signin
You should see a Set-Cookie value in the output, like this:
Set-Cookie: grpc-cookies-example-session=MTU0MTE3MTUwOHxEdi1CQkFFQ180SUFBUkFCRUFBQVFfLUNBQUVHYzNSeWFXNW5EQWdBQm5WelpYSkpaQTBxYldGcGJpNVRaWE56YVc5dV80TURBUUVIVTJWemMybHZiZ0hfaEFBQkFRRUdWWE5sY2tsRUFRUUFBQUFKXzRRR0FmMERBNW9BfG1GuOnjcScQCaptcXYeKBjbhYG-cq0ongAMO_vn1dc4; Path=/; Expires=Fri, 02 Nov 2018 19:11:48 GMT; Max-Age=14400; HttpOnly
FAQs
Unknown package
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.