
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).
github.com/warky-devs/resolvespec
ResolveSpec is a flexible and powerful REST API specification and implementation that provides GraphQL-like capabilities while maintaining REST simplicity. It allows for dynamic data querying, relationship preloading, and complex filtering through a clean, URL-based interface.
/[schema]/[table_or_entity]/[id]
/[schema]/[table_or_entity]
/[schema]/[function]
/[schema]/[virtual]
{
"operation": "read|create|update|delete",
"data": {
// For create/update operations
},
"options": {
"preload": [...],
"columns": [...],
"filters": [...],
"sort": [...],
"limit": number,
"offset": number,
"customOperators": [...],
"computedColumns": [...]
}
}
POST /core/users
{
"operation": "read",
"options": {
"columns": ["id", "name", "email"],
"preload": [
{
"relation": "posts",
"columns": ["id", "title"],
"filters": [
{
"column": "status",
"operator": "eq",
"value": "published"
}
]
}
],
"filters": [
{
"column": "active",
"operator": "eq",
"value": true
}
],
"sort": [
{
"column": "created_at",
"direction": "desc"
}
],
"limit": 10,
"offset": 0
}
}
go get github.com/Warky-Devs/ResolveSpec
import "github.com/Warky-Devs/ResolveSpec"
handler := resolvespec.NewAPIHandler(db)
// Register your models
handler.RegisterModel("core", "users", &User{})
handler.RegisterModel("core", "posts", &Post{})
Using Gin:
func setupGin(handler *resolvespec.APIHandler) *gin.Engine {
r := gin.Default()
r.POST("/:schema/:entity", func(c *gin.Context) {
params := map[string]string{
"schema": c.Param("schema"),
"entity": c.Param("entity"),
"id": c.Param("id"),
}
handler.SetParams(params)
handler.Handle(c.Writer, c.Request)
})
return r
}
Using Mux:
func setupMux(handler *resolvespec.APIHandler) *mux.Router {
r := mux.NewRouter()
r.HandleFunc("/{schema}/{entity}", func(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
handler.SetParams(vars)
handler.Handle(w, r)
}).Methods("POST")
return r
}
type User struct {
ID uint `json:"id" gorm:"primaryKey"`
Name string `json:"name"`
Email string `json:"email"`
Posts []Post `json:"posts,omitempty" gorm:"foreignKey:UserID"`
}
handler.RegisterModel("core", "users", &User{})
Supported operators:
Support for multiple sort criteria with direction:
"sort": [
{
"column": "created_at",
"direction": "desc"
},
{
"column": "name",
"direction": "asc"
}
]
Define virtual columns using SQL expressions:
"computedColumns": [
{
"name": "full_name",
"expression": "CONCAT(first_name, ' ', last_name)"
}
]
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
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.