File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,10 @@ RUN npm config set ignore-scripts true --location=global && \
343343 echo 'ignore-scripts true' >> ~/.yarnrc
344344
345345# Disable npx (security hardening - prevents arbitrary package execution)
346- RUN rm -f /usr/bin/npx /usr/local/bin/npx /root/.nvm/versions/node/v${NODE_VERSION}/bin/npx && \
346+ # Remove npx from NVM and replace with stub that prints warning
347+ RUN rm -f /usr/bin/npx /usr/local/bin/npx && \
348+ rm -f /root/.nvm/versions/node/v${NODE_VERSION}/bin/npx && \
349+ rm -f /root/.nvm/versions/node/v${NODE_VERSION}/lib/node_modules/npm/bin/npx-cli.js && \
347350 echo '#!/bin/sh' > /usr/local/bin/npx && \
348351 echo 'echo "npx is disabled for security reasons. Use explicit package installation instead." >&2' >> /usr/local/bin/npx && \
349352 echo 'exit 1' >> /usr/local/bin/npx && \
You can’t perform that action at this time.
0 commit comments