sfw free blocks fontawesome registry

Open
#24 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
security, tooling

Research direction

Start by reproducing the reported sfw pnpm install failure using the shown package.json and pnpm registry/authentication settings. Check how Socket Firewall handles the @fortawesome registry and private package fetches; done means the listed Font Awesome packages install successfully through sfw without weakening protection for unrelated packages.

Written by the indexing model from the issue text.

Description

Hi and thanks for sfw ❤️

In one of our repo, we use the private fontawesome registry.
I think it's a nomal behavior since the doc says that sfw free doesn't support private registry, but maybe fontawesome is so widely used that you may want to whitelist it 🤷

Any way, whith a clean repo (no node_modules) and a clean pnpm store, here is the error I get when trying to fetch a fontawesome package :

❯ sfw pnpm install
Protected by Socket Firewall
Lockfile is up to date, resolution step is skipped
Packages: +15
+++++++++++++++
 ERR_PNPM_FETCH_403  GET https://npm.fontawesome.com/@fortawesome/pro-duotone-svg-icons/-/pro-duotone-svg-icons-6.2.1.tgz: Forbidden - 403

An authorization header was used: Bearer 671F[hidden]

These authorization settings were found:
@jsr:registry=https://npm.jsr.io/
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=671F[hidden]
//registry.npmjs.org/:_authToken=npm_[hidden]
Progress: resolved 15, reused 0, downloaded 1, added 0

=== Socket Firewall ===

 - 1 packages fetched successfully

And here is the package.json that goes with it :

{
  "name": "repro_sfw_fontawesome",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "setup": "node ./scripts/private-dep.js"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "6.2.1",
    "@fortawesome/pro-duotone-svg-icons": "6.2.1",
    "@fortawesome/pro-light-svg-icons": "6.2.1",
    "@fortawesome/pro-regular-svg-icons": "6.2.1",
    "@fortawesome/pro-solid-svg-icons": "6.2.1",
    "@fortawesome/pro-thin-svg-icons": "6.2.1",
    "@fortawesome/react-fontawesome": "0.2.0",
    "@fortawesome/sharp-solid-svg-icons": "6.2.1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "packageManager": "[email protected]"
}

And the fontawesome private repo setup :

  pnpm config set "@fortawesome:registry" https://npm.fontawesome.com/
  pnpm config set "//npm.fontawesome.com/:_authToken" "${token}"`
Dominant language
No language data
Stars
271
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SocketDev/sfw-free

All issues in SocketDev/sfw-free

Similar issues

More Security issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.