Replies: 4 comments 1 reply
|
To think about this kind of silent 403 error on npm is that the registry authorization layer is hitting a specific restriction on the package record itself rather than failing your user account or 2FA credentials, you know? It is basically telling the CLI that while your identity checks out, this specific package identifier is blocked by a registry rule or an organization tier quota First off, to actually see the unredacted error payload that the npm CLI hides, you can run A really common catch with scoped packages that suddenly start throwing a 403 on restricted publishes is your npm organization private package billing status, like if a payment failed, a trial lapsed, or private package limits were reached, npm quietly blocks private publishes under that org while still allowing public packages and regular auth, so double checking your organization billing tab on npmjs is definitely worth a look Also, since you are publishing a fork of |
|
Hey, nice job narrowing this down already the OTP behavior difference is a great clue. A few things worth trying: See the actual error body (npm's CLI hides it): That'll show you the real JSON response instead of npm's generic message. My best guess given your symptoms (no OTP prompt at all, straight 403, everything else identical): npm likely has an internal security/similarity policy flagging the base name Quick way to test that theory: try publishing under a different name, like For support, since you've waited days already, reply on the same ticket (don't open a new one) and mention explicitly that you suspect a name/security-policy block, not an auth issue. That tends to get routed to the right team faster. In the meantime, GitHub Packages is a solid fallback for scoped private packages if you need to unblock CI. |
|
That is an incredibly frustrating issue, especially with the silent failure of the OTP prompt and the radio silence from support. Let's break down how to extract the raw error response, and then look at the registry's system design to understand exactly why that OTP prompt is being skipped. How to See the Raw 403 ResponseBy default, the npm CLI swallows the HTTP response body on 4xx errors. To force the CLI to dump the raw HTTP transaction (including headers and the JSON response body from the registry), run the publish command with the npm publish --loglevel silly > publish-debug.log 2>&1
Open Analyzing the Clues: Why the OTP Prompt is MissingYour observation about the missing OTP prompt is the smoking gun here. It tells us exactly where in the npm registry's architecture this request is being rejected. In the npm registry system design, the publication flow works like this:
If the CLI goes straight to 403 and skips the browser prompt, it means the registry never issued the 401 OTP challenge. The server evaluated your initial request and hit a hard, unconditional block before or independent of the 2FA layer. The Most Likely CulpritsGiven that this is a private fork of 1. Automated Security Flagging (Most Likely) 2. Typosquatting / Name Squatting Protections 3. Spam Filter False Positive Next Steps
|
|
Thank you all for the suggestions - unfortunately none of them really bore much fruit. What I've currently landed on is that the 403 was the result of a security scan done on the contents of my README file. It currently contains demonstration code of an attack surface the port mitigates, patterns for avoiding xpath DOS'es and mentions of multiple CVE's that have been mitigated by the port. I think one or all of these tripped some content block. I come to that conclusion because trying to publish the package under an entirely new company namespaced nonsense name without any binaries and only 3 files (one being the forks's full README) also 403'ed and publishing a different namespaced single file repo with a nearly blank README worked without issue. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
I'm working on a private fork of the unmaintained package
libxmljs. My fork is namespaced as@${mycompany}/libxmljs.I had originally set it up to publish via Github Actions OIDC and confirmed it was working - I published several beta versions of the package. A couple weeks ago the publishing pipeline stopped functioning with out any perceptible change to any - no Github settings were changed at the repo level or the org level and nothing was changed in the npm package settings. I spent some time trying to diagnose it - the OIDC token exchange worked fine, the permissioning was correct but I couldn't get it to not 403 on the publish step. It always errored with the following:
Nothing worked so I resolved to simply just do manual deploys for the time being. However, I'm now also getting the same 403 errors when trying to publish manually. I know my token is valid and hasn't expired yet - I used it to publish other internal packages regularly.
Already ruled out:
token permissions, both "Publishing access" settings, version string (4 unused versions tried), payload (a 49 kB binary-free tarball fails the same as the real 2.1 MB one), .npmrc differences, and ownership (maintainer list identical to the working package).
Two things that might narrow it:
Is there any way to see the real reason behind that 403 — the CLI discards the response body.
I have already tried contacting npm support but haven't heard anything for several days.
All reactions