Skip to content
  • Home
  • Cyber Map
  • About Us – Contact
  • Disclaimer
  • Terms and Rules
  • Privacy Policy
Cyber Web Spider Blog – News

Cyber Web Spider Blog – News

Globe Threat Map provides a real-time, interactive 3D visualization of global cyber threats. Monitor DDoS attacks, malware, and hacking attempts with geo-located arcs on a rotating globe. Stay informed with live logs and archive stats.

  • Home
  • Cyber Map
  • Cyber Security News
  • Security Week News
  • The Hacker News
  • How To?
  • Toggle search form
GitHub to Restrict npm Scripts by Default to Enhance Security

GitHub to Restrict npm Scripts by Default to Enhance Security

Posted on June 13, 2026 By CWS

GitHub is set to implement significant security updates in version 12 of npm, aiming to bolster defenses against software supply chain threats. Announced on June 11, 2026, these changes include disabling install scripts by default, a move designed to prevent the automatic execution of potentially harmful code.

New Security Measures in npm

The forthcoming npm changes target attack strategies that exploit the ‘npm install’ command. This command is vital for downloading and installing dependencies for Node.js projects. However, it also presents a vulnerability: it can execute scripts from all transitive dependencies, risking arbitrary code execution if even one package in the chain is compromised. Scheduled for release next month, npm version 12 will address these concerns.

By requiring user consent before any code execution during the install process, GitHub aims to close a significant security loophole. The company stated that making script execution an opt-in process ensures only trusted packages can execute scripts automatically.

Specific Changes and Their Implications

Under the new rules, ‘npm install’ will not execute preinstall, install, or postinstall scripts from dependencies unless explicitly permitted. Additionally, Git dependencies will not be resolved unless the –allow-git flag is used. Similarly, dependencies from remote URLs will require the –allow-remote flag.

This approach also extends to node-gyp builds. Even without an explicit install script, packages with a binding.gyp will face restrictions due to npm’s default behavior of running an implicit node-gyp rebuild.

To prepare for these changes, GitHub advises developers to update to npm 11.16.0 or newer and review the warnings that appear during installations. This proactive preparation will help developers smoothly transition to the new system.

Guidance for Developers

GitHub suggests using the ‘npm approve-scripts –allow-scripts-pending’ command to identify which packages have scripts and to approve those deemed trustworthy. By committing the updated package.json, developers ensure only these approved scripts will run after upgrading to version 12.

Additionally, npm’s earlier introduction of the ‘min-release-age’ setting provides further protection by rejecting any package version published too recently, mitigating the risk from newly released malicious packages.

In conclusion, these updates represent a substantial shift in npm’s security posture, prioritizing developer safety and reducing the risk of supply chain attacks. As software development increasingly relies on open-source components, such proactive measures are critical to maintaining secure digital infrastructures.

The Hacker News Tags:code execution, developer security, GitHub, lifecycle scripts, Node.js, NPM, npm install, npm update, Security, software development, software supply chain, supply chain attacks

Post navigation

Previous Post: Critical Flaw in Splunk Enterprise Enables Unauthorized Code Execution
Next Post: China-Linked JDY Botnet Expands to Over 1,500 Devices

Related Posts

CountLoader Broadens Russian Ransomware Operations With Multi-Version Malware Loader CountLoader Broadens Russian Ransomware Operations With Multi-Version Malware Loader The Hacker News
Reducing Attack Surface: Key Strategies Explained Reducing Attack Surface: Key Strategies Explained The Hacker News
Cryptojacking Campaign Exploits DevOps APIs Using Off-the-Shelf Tools from GitHub Cryptojacking Campaign Exploits DevOps APIs Using Off-the-Shelf Tools from GitHub The Hacker News
AI Model Uncovers 10,000 Critical Software Flaws AI Model Uncovers 10,000 Critical Software Flaws The Hacker News
Cybersecurity Threats Intensify with New Vulnerabilities Cybersecurity Threats Intensify with New Vulnerabilities The Hacker News
6 Browser-Based Attacks Security Teams Need to Prepare For Right Now 6 Browser-Based Attacks Security Teams Need to Prepare For Right Now The Hacker News

Categories

  • Cyber Security News
  • How To?
  • Security Week News
  • The Hacker News

Recent Posts

  • GitHub’s NPM 12 Blocks Script Execution to Enhance Security
  • China-Linked JDY Botnet Expands to Over 1,500 Devices
  • GitHub to Restrict npm Scripts by Default to Enhance Security
  • Critical Flaw in Splunk Enterprise Enables Unauthorized Code Execution
  • BugHunter Toolkit Enhances Vulnerability Detection

Pages

  • About Us – Contact
  • Disclaimer
  • Privacy Policy
  • Terms and Rules

Archives

  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025

Recent Posts

  • GitHub’s NPM 12 Blocks Script Execution to Enhance Security
  • China-Linked JDY Botnet Expands to Over 1,500 Devices
  • GitHub to Restrict npm Scripts by Default to Enhance Security
  • Critical Flaw in Splunk Enterprise Enables Unauthorized Code Execution
  • BugHunter Toolkit Enhances Vulnerability Detection

Pages

  • About Us – Contact
  • Disclaimer
  • Privacy Policy
  • Terms and Rules

Categories

  • Cyber Security News
  • How To?
  • Security Week News
  • The Hacker News

Copyright © 2026 Cyber Web Spider Blog – News.

Powered by PressBook Masonry Dark