Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Mendoza decoder in TypeScript.
npm install mendoza
or
pnpm install mendoza
or
yarn add mendoza
Basic example:
import {applyPatch} from "mendoza"
let left = {…};
let patch = […];
let right = applyPatch(left, patch);
Incremental patcher:
import {incremental} from "mendoza"
const {Value, rebaseValue, wrap, unwrap, getType, applyPatch} = incremental
// Create an empty initial version:
const ROOT = wrap(null, null);
// Input of patches:
let patches = […];
// `origin` can be whatever you want to identify where a change comes from:
let origin = 0;
// Reference to the latest version:
let value = ROOT;
// Rebasing is for maintaing history across deleted versions:
let rebaseTarget;
for (let patch of patches) {
// Apply the patch:
let newValue = applyPatch(value, patch, origin);
// Rebase if needed:
if (rebaseTarget) {
newValue = rebaseValue(rebaseTarget, newValue);
}
// If the document was deleted, store the previous version so we can rebase:
if (getType(newValue) === "null") {
rebaseTarget = value;
} else {
rebaseTarget = null;
}
value = newValue;
origin++;
}
// Return the final full object:
console.log(unwrap(value));
MIT © Sanity.io
Run the "CI & Release" workflow. Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.
FAQs
Mendoza, differ for structured documents
The npm package mendoza receives a total of 151,320 weekly downloads. As such, mendoza popularity was classified as popular.
We found that mendoza demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 47 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.