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.
@roast-cms/link-tool
Advanced tools
link-tool
A Node.js API for managing affiliate links.
This project creates an API service which will return a link (most likely a URL) in response to a key (could be another url) and parameters (like locale). You can use the returned URL to either create redirects (link cloaking) or to simply manage links the HTML of your blog, website, or a tool. This tools is currently in development -- see releases.
/recommends/widget?locale=us
{
"link": "https://shop.com/us/widget?referral=you"
}
For this example to work, MongoDB collection links
should have the following document (vendors[].locale
is optional):
{
"link": "widget",
"vendors": [
{
"url": "https://shop.com/us/widget?referral=you",
"value": 1,
"locale": "us"
}
]
}
This an example using React framework, however, the idea would be the same in any kind of project (both on server and on the browser):
link-tool
service with the key (must be a string) as a URL path and any parameters sent as a query.export const MyPage = () => {
// manage state of the app (React-specific)
const [myLink, setMyLink] = useState("#default-link");
// send fetch request on page load and update state
useEffect(() => {
try {
const linkResponse = await fetch("/recommends/widget?locale=us");
const linkResponseJson = await linkResponse.json();
setMyLink(linkResponseJson.link);
} catch(error) {
console.log(error);
}
},[]);
// return page HTML
return <div>This is my example text, oh, and look: an affiliate <a href={myLink}>link</link>!</div>
}
After you've installed MongoDB (I recommend you also install MongoDB Compass) and Redis on your machine, create .env
file in the root of this project folder and use .env.example
as a template. For APPLICATION_SECRET
, you'll need to create your own string of random numbers/letters (make sure to add your .env
to .gitignore
and not to share it publicly).
Then you can yarn dev
to run the sample server.
FAQs
A Node.js API for managing affiliate links.
The npm package @roast-cms/link-tool receives a total of 0 weekly downloads. As such, @roast-cms/link-tool popularity was classified as not popular.
We found that @roast-cms/link-tool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.