Malformed Socket API responses allow known-malware test packages through SFW
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start with the SFW CLI path that handles Socket API alert lookup failures and the wrapped command's exit status. Reproduce the provided lodahs command, then run the blocking assertions referenced in the issue across the supported platforms. Done means the known-malware package is blocked and an alert lookup failure cannot result in a successful download or exit.
Written by the indexing model from the issue text.
Description
SFW allows documented malware test packages to download when alert lookups fail with Malformed Socket API response (Invalid input). The wrapped command exits successfully.
Reproduced with the native release binaries for SFW 1.15.1 and 1.15.2 on macOS ARM64. Our CI also fails its blocking assertions on Linux, macOS, and Windows.
Reproduction
This requests the lodahs security placeholder and discards the download without executing package code:
SFW_DEBUG=true sfw --verbose curl \
--fail --silent --show-error --max-time 25 \
https://registry.npmjs.org/lodahs/-/lodahs-0.0.1-security.tgz \
-o /dev/null
echo $?
Actual behavior
The download succeeds and the exit code is 0. Debug output includes:
Error occurred: error while fetching package alerts
{"errors":["Malformed Socket API response (Invalid input)"],"purlStrings":["pkg:npm/[email protected]"]}
There is no package-block message.
Expected behavior
lodahs should be blocked, as described in Socket's sample-package documentation. Alert lookup failures should clearly indicate that protection failed.
Additional evidence
- The same error occurs with
crossenv,babelcli,mongose,axois,node-click, andwebb3. Their security placeholder downloads also succeed. - A benign control,
[email protected], produces a normalpackageAllowedevent without an API error. - The blocking check passed on September 15 with SFW
1.15.1and Vite+0.3.2. - It failed on September 16, including a retry, with the same versions.
This resembles #61's successful exit after an internal error, but here the wrapped command completes and downloads the package. I have not confirmed whether the root cause is related.
- Dominant language
- No language data
- Stars
- 271
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SocketDev/sfw-free
-
Difficulty 1/5 Under an hour Newbie friendliness 87/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in SocketDev/sfw-free
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/app-deconz#11 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMPossibly taken @olegius88 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
[Wrath][Cata][Mists] Class quests without a class restriction, and FLAG quests, show to every playerOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day