Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@oslojs/oauth2
Advanced tools
Documentation: https://oauth2.oslojs.dev
A small JavaScript library for parsing OAuth 2.0 token, token revocation, and device authorization responses by Oslo.
This package follows RFC 6749, RFC 7009, and RFC 8628.
import { TokenRequestResult } from "@oslojs/oauth2";
const response = await fetch("https://github.com/login/oauth/access_token", {
method: "POST",
body,
headers
});
const data = await response.json();
if (typeof data !== "object" || data === null) {
throw new Error("Unexpected response");
}
const result = new TokenRequestResult(data);
if (result.hasErrorCode()) {
const error = result.errorCode();
throw new Error(`Request failed: ${error}`);
}
const accessToken = result.accessToken();
const accessTokenExpiresAt = result.accessTokenExpiresAt();
const refreshToken = result.refreshToken();
npm i @oslojs/oauth2
FAQs
A runtime-agnostic OAuth 2.0 library
We found that @oslojs/oauth2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.