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.
@ampproject/toolbox-cache-url
Advanced tools
Translates an URL from the origin to the AMP Cache URL format, according to the specification available in the AMP documentation. This includes the SHA256 fallback URLs used by the AMP Cache on invalid human-readable cache urls.
Install via:
$ npm install @ampproject/toolbox-cache-url
import {ampToolboxCacheUrl} from '@ampproject/toolbox-cache-url';
const ampToolboxCacheUrl = require('@ampproject/toolbox-cache-url');
In the browser, include the UMD module in an HTML <script>
tag. If using node, replace window
with global
.
const {ampToolboxCacheUrl} = window.ToolboxCacheUrl;
// Get an AMP Cache URL from a cache domain, and a canonical URL
ampToolboxCacheUrl.createCacheUrl('cdn.ampproject.org', 'https://www.example.com').then((cacheUrl) => {
// This would log:
// 'https://www-example-com.cdn.ampproject.org/c/s/www.example.com/'
console.log(cacheUrl);
});
// Transform a canonical URL to an AMP Cache subdomain
ampToolboxCacheUrl.createCurlsSubdomain('https://www.example.com').then((curlsSubdomain) => {
// This would log:
// 'www-example-com'
console.log(curlsSubdomain);
});
FAQs
Transform canonical URLs into AMP Cache URLs
The npm package @ampproject/toolbox-cache-url receives a total of 567 weekly downloads. As such, @ampproject/toolbox-cache-url popularity was classified as not popular.
We found that @ampproject/toolbox-cache-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 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.