
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
mygithub.libinneed.workers.dev/usk81/generic
flexible data type for Go
standard go get
:
go get -u github.com/usk81/generic
encode/decode:
package main
import (
"encoding/json"
"github.com/usk81/generic"
)
type User struct {
Name String `json:"name"`
Age generic.Int `json:"age"`
}
var user1 User
u1 := []byte(`{"name":"Daryl Dixon","age":"40"}`)
json.Unmarshal([]byte(u1), &user1)
b, _ := json.Marshal(user1)
Println(string(b))
// {"name":"Daryl Dixon","age":40}
var user2 User
u2 := []byte(`{"name":"Rick Grimes"}`)
json.Unmarshal([]byte(u2), &user2)
b, _ := json.Marshal(user2)
Println(string(b))
// {"name":"Rick Grimes","age":null}
set:
package main
import (
"fmt"
"github.com/usk81/generic"
)
func main() {
v := 1.0
var tb generic.Bool
tb.Set(v)
vb := tb.Value()
fmt.Printf("%v, (%T)\n", vb, vb)
// true, (bool)
var tf generic.Float
tf.Set(v)
vf := tf.Value()
fmt.Printf("%v, (%T)\n", vf, vf)
// 1, (float64)
var ti generic.Int
ti.Set(v)
vi := ti.Value()
fmt.Printf("%v, (%T)\n", vi, vi)
// 1, (int64)
var ts generic.String
ts.Set(v)
vs := ts.Value()
fmt.Printf("%v, (%T)\n", vs, vs)
// 1, (string)
var tt generic.Time
tt.Set(v)
vt := tt.Value()
fmt.Printf("%v, (%T)\n", vt.UTC(), vt)
// 1970-01-01 09:00:01 +0900 JST, (time.Time)
var tu generic.Uint
tu.Set(v)
vu := tu.Value()
fmt.Printf("%v, (%T)\n", vu, vu)
// 1, (uint64)
}
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 flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.