
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
github.com/FriendlyCaptcha/friendly-captcha-go
Advanced tools
A Go client for the Friendly Captcha service. This client allows for easy integration and verification of captcha responses and retrieval of risk intelligence data with the Friendly Captcha API.
This library is for Friendly Captcha V2 only. If you are looking for V1, look here
go get github.com/friendlycaptcha/friendly-captcha-go
Below are basic examples of how to use the client.
For a more detailed end-to-end example (captcha verification + risk intelligence retrieval in one app), take a look at the example directory.
import friendlycaptcha "github.com/friendlycaptcha/friendly-captcha-go"
...
opts := []friendlycaptcha.ClientOption{
friendlycaptcha.WithAPIKey("YOUR_API_KEY"),
friendlycaptcha.WithSitekey("YOUR_SITEKEY"),
}
frcClient, err := friendlycaptcha.NewClient(opts...)
if err != nil {
// handle possible configuration error
}
Use VerifyCaptchaResponse for the captcha flow via the siteverify endpoint (/api/v2/captcha/siteverify).
After calling VerifyCaptchaResponse with the captcha response there are two functions on the result object that you should check:
WasAbleToVerify() indicates whether we were able to verify the captcha response. This will be false in case there was an issue with the network/our service or if there was a mistake in the configuration.ShouldAccept() indicates whether the captcha response was correct. If the client is running in non-strict mode (default) and WasAbleToVerify() returned false, this will be true.Below are some examples of this behaviour.
result := frcClient.VerifyCaptchaResponse(context.TODO(), "CORRECT_CAPTCHA_RESPONSE_HERE")
fmt.Println(result.WasAbleToVerify()) // true
fmt.Println(result.ShouldAccept()) // true
result := frcClient.VerifyCaptchaResponse(context.TODO(), "INCORRECT_CAPTCHA_RESPONSE_HERE")
fmt.Println(result.WasAbleToVerify()) // true
fmt.Println(result.ShouldAccept()) // false
result := frcClient.VerifyCaptchaResponse(context.TODO(), "INCORRECT_CAPTCHA_RESPONSE_HERE")
fmt.Println(result.WasAbleToVerify()) // false
fmt.Println(result.ShouldAccept()) // true
frcClient, _ := friendlycaptcha.NewClient(
...
friendlycaptcha.WithStrictMode(true),
)
result := frcClient.VerifyCaptchaResponse(context.TODO(), "INCORRECT_CAPTCHA_RESPONSE_HERE")
fmt.Println(result.WasAbleToVerify()) // false
fmt.Println(result.ShouldAccept()) // false
Call RetrieveRiskIntelligence to retrieve risk intelligence data from a token via the retrieve endpoint (/api/v2/riskIntelligence/retrieve).
result := frcClient.RetrieveRiskIntelligence(context.TODO(), "RISK_INTELLIGENCE_TOKEN_HERE")
if !result.WasAbleToRetrieve() {
// handle request/client error, inspect result.RequestError()
return
}
if !result.IsValid() {
// handle invalid token, inspect result.Response().Error
return
}
// The risk intelligence data is available in result.Response().Data.
data := result.Response().Data.RiskIntelligence
The client offers several configuration options:
VerifyCaptchaResponse returns True regardless. By passing WithStrictMode(true), it will return false instead: every response needs to be strictly verified.eu or global are also accepted. Default is global.First run the SDK Test server, then run go test.
docker run -p 1090:1090 friendlycaptcha/sdk-testserver:latest
go test -v -tags=sdkintegration ./...
Open source under MIT.
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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.