
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/yongxinz/lanxinplus-openapi-go-sdk
- Go 1.13及以上
- 运行
go get github.com/lanxinplus/lanxinplus-openapi-go-sdk/sdk
命令获取远程代码包- 在您的代码中使用
import "github.com/lanxinplus/lanxinplus-openapi-go-sdk/sdk"
来引入 Go SDK包
import (
"context"
"fmt"
"github.com/lanxinplus/lanxinplus-openapi-go-sdk/sdk"
)
//注:以下配置信息从蓝信 开发者中心-应用开发-基本信息 中获取
const (
SERVER = "" // 蓝信开放平台网关地址, e.g.: https://example.com/open/apigw
APP_ID = "" // 应用ID, e.g.: 1234567-7654321
APP_SECRET = "" // 应用密钥, e.g.: D25F65E65D887AEFD9C92B00310286FA
)
func Example() {
client, err := sdk.NewClientWithResponses(SERVER)
if err != nil {
// HandleError(err)
}
params := sdk.V1AppTokenCreateParams{}
params.SetGrantType("client_credential").
SetAppid(APP_ID).
SetSecret(APP_SECRET)
// 返回内部处理的 Response
resp, err := client.V1AppTokenCreateWithResponse(context.TODO(), ¶ms)
if err != nil {
// HandleError(err)
}
fmt.Println(resp.ToString())
fmt.Println(resp.GetErrCode())
fmt.Println(resp.GetData().GetAppToken())
fmt.Println(resp.GetData().GetExpiresIn())
}
- 拷贝示例文件到Go SDK的安装路径(即GOPATH变量中的第一个路径),进入Go SDK的代码目录
src/github.com/lanxinplus/lanxinplus-openapi-go-sdk/sdk
- 修改sdk_test.go文件const里的SERVER、APP_ID、APP_SECRET 配置
- 请在您的工程目录下执行
go test -run Test_XXX
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.