-
Notifications
You must be signed in to change notification settings - Fork 0
Gate: the registry reads your docs #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arnelirobles
wants to merge
1
commit into
main
Choose a base branch
from
gate/registry-reads-your-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: BaryoDev/.github
Length of output: 4258
🏁 Script executed:
Repository: BaryoDev/.github
Length of output: 1837
🌐 Web query:
npm publish documentation one-time password prompt registry 2FA publish request content scanning order💡 Result:
When using npm publish, the interaction between authentication, malware scanning, and registry requirements follows a specific flow designed for supply-chain security. 2FA and OTP Requirements Publishing to the npm registry requires either 2FA enabled on your account or the use of a granular access token with bypass 2FA enabled [1][2]. If 2FA is enabled (specifically in auth-and-writes mode), the registry will challenge the publish request for a one-time password (OTP) [3]. When a challenge is issued, the npm CLI behavior is as follows: - Interactive Environments: If you are running the command in a terminal (TTY), the CLI will detect the challenge and prompt you directly to enter the OTP [4][3]. - Providing OTP manually: You can bypass the prompt by providing the code via the --otp flag (e.g., npm publish --otp=123456) [5][4]. - Failure/Error Handling: If the provided OTP is incorrect, expired, or the CLI fails to detect the challenge, the publish operation will fail with an error [6][4][7]. Malware Scanning and Publish Order As of July 2026, npm automatically scans all newly published packages for malware [8][9]. This process is integrated into the publishing pipeline, occurring after the initial request reaches the registry [8][10]. 1. Submission: When you execute npm publish, the package is sent to the registry [8][11]. 2. Scanning: The registry performs automated static and dynamic analysis [10]. This typically introduces a delay of about 5 minutes, though it can take 15 minutes or longer during peak times [8][9]. 3. Availability: During the scan, the package is not yet installable [8]. Once the scan is complete, the package is published as normal, held for manual review, or blocked [8][9]. Dual-Use Content For packages containing security-relevant capabilities ("dual-use content"), specific requirements apply to maintain the integrity of the registry [12]: - Metadata: You must include a contentPolicy field in package.json and a DISCLOSURE file at the root of the package [8][9]. - 2FA Enforcement: Dual-use packages must be published through a 2FA-enforced method (e.g., interactive publish with 2FA or staged publishing) [12]. - Persistence: Once a version includes dual-use metadata, all subsequent versions must retain it [8][9]. Staged Publishing Staged publishing allows developers to submit a package to a staging area without immediately making it public [13]. This method is compatible with various credentials, including those that bypass 2FA (for the staging step), but it requires 2FA to be enforced during the final promotion to the live registry [13][12]. This is an effective way to handle CI/CD workflows while still adhering to the 2FA requirement for the final release [1][12].
Citations:
npm publishdoes not prompt for OTP npm/cli#4519Scope the OTP result as an incident-specific heuristic.
An npm OTP prompt shows that the registry issued an OTP challenge. It does not establish that content scanning completed before the prompt. If this is a general bisection rule, record the npm CLI version, registry, authentication flow, and response codes used for this incident.
🤖 Prompt for AI Agents