
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
github.com/mralanlee/url-shortener-api
Advanced tools
URL Shortener written in Go. Really fun project since I generally build APIs in Node.js and primarily use NoSQL databases. This task took me about ~5.5 hours.
$ docker-compose up --build
Dependencies from the Docker image are MySQL and Golang.
I didn't get a chance to write all the tests that I could as I wanted to stay as close to the 4 hour mark. I didn't get to approach it in a more idomatic way. When I started working on it, I realized I ended up setting it up as more of an end-to-end test instead of actual unit tests.
$ docker-compose -f docker-compose.test.yml up --build -d
$ go test -v
I also approached the tests in a Table Test way, so it would be more DRY.
There is a concept of the slug, where that's the randomized token that unlocks or redirects you to the original source.
POST /api/shorten Shorten's URLs
curl -X "POST" "http://localhost:3000/api/shorten" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"url": "http://localhost:3000/asdfdsf"
}'
GET /api/stats?url= Get Stats
curl "http://localhost:3000/api/stats?id={slug}"
GET /{slug} Redirect
curl "http://localhost:3000/{slug}"
http://localhost/${slug}.)
- Is Unique; If a long url is added twice it should result in two different short urls.
- Not easily discoverable; incrementing an already existing short url should have a low probability of finding a working short url.
All the validation should occur at the handler level, that way the database doesn't get bogged down trying to figure out whether a URL is valid or not.
POST request respond with 405500url key and/or value is not a url respond with bad requesttrigger to increment on read but I don't think that's possible.url.ParseRequestURI. (Source)try/catch in the majority of my work experience.If I had more time, I would have focused on the following items:
I tried my best to stay as close to a 4 hour time requirement.
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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.