Repository navigation
build: update all dependencies and fix device id command injection - #260
Merged
Merged
Conversation
Device ids received over the unauthenticated RPC API were interpolated into shell commands and PKI file paths, allowing root command execution from any container on dncore_network. Commands now run through execFile and ids with path separators, whitespace or a leading dash are rejected.
Removing a device threw ENOENT because easy-rsa already moves revoked files, so its share tokens were never deleted. The internal IP is now read from _DAPPNODE_GLOBAL_INTERNAL_IP, the credentials server no longer destroys the socket after an error response, the client-connect guard matches loopback exactly and its hook logs the right URL.
Updates every backend dependency to its latest release (TypeScript 6.0, express 5, yargs 18, ESLint 10, mocha 12, chai 6, sinon 22) and replaces got, lodash, ip, dargs and chalk with Node built-ins. The image moves to Alpine 3.24 (Node 24, OpenVPN 2.7, easy-rsa 3.2).
Create React App is deprecated and pulled in most of the open advisories. The UI now builds with Vite into a single self-contained HTML file and runs on React 19 and Bootstrap 5, with Bootstrap 4 link and gutter styles kept so it renders identically. Unused platform pages, icons, router redirect and service worker are removed.
The dappnodesdk now requires Node 22.13 or later, so the build workflow sets up Node explicitly. The UI is linted, tested and built in CI.
|
Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 1c957a8 This is a development version and should only be installed for testing purposes.
Hash: (by dappnodebot/build-action) |
The PKI keeps the CA and server keys next to the device keys, so asking for the credentials of "ca" or the server name returned their private keys, and resetting the server name replaced its certificate. Reading and resetting now require a listed device, and names with glob characters or commas are rejected.
Vite defaults to browsers from the last couple of years, while the previous build was ES5. Share links are opened on arbitrary devices.
This was referenced Nov 25, 2026
This was referenced Nov 25, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What type of PR is this?
What does this PR do? Why is it needed?
Brings every dependency up to date, clears all open Dependabot alerts, and fixes the bugs found along the way. No new features. Each commit stands on its own:
fix(openvpn): run commands without a shell and validate device ids. Device ids received over the unauthenticated RPC API (reachable fromdncore_network) were interpolated into shell commands and PKI file paths, allowing command execution as root in the privileged VPN container. Commands now run throughexecFile, and ids containing path separators, whitespace or a leading-are rejected. This commit builds and passes tests on the old toolchain, so it can be cherry-picked on its own.fix: device removal, internal IP env and credentials responses.vpncli rm/removeDevicethrewENOENTin the current production image because easy-rsa already moves revoked files, so the device's share tokens were never deleted.INTERNAL_IPinstead of_DAPPNODE_GLOBAL_INTERNAL_IP, so the global env was never used.127.0.0.10passed).urlmodule instead of the URL.build: backend and image to Node 24 and Alpine 3.24.got,lodash,ip(unpatched advisory),dargsandchalkare replaced with Node built-ins.ovpn_initpkiuses the current--genkey secretsyntax.modcleanand the native build toolchain were dropped (all deps are pure JS).src/index.tsdebug server.style: Prettier 3 formatting of files that had no other changes.build(ui): create-react-app → Vite. CRA is deprecated and pulled in most of the advisories.vite-plugin-singlefilereplacesinjectToHtml.jsand still produces one self-contained HTML file.ci: actions v7, Node 24, plus a UI lint/test/build job. The build workflow now sets Node explicitly because@dappnode/dappnodesdkrequires Node 22.13 or later.fix(openvpn): only act on listed devices and reject glob names. The PKI keeps the CA and server keys next to the device keys, so reading or resetting credentials for a non-device id reached them.getClientandresetDevicenow require the id to be in the device list, and names containing* ? [ ] ,are rejected.build(ui): target es2017. The previous build was ES5 and Vite defaults to recent browsers only; share links are opened on arbitrary devices.yarn auditreports 0 vulnerabilities in bothsrcandui_openvpn. mocha'sglob/minimatchare pinned viaresolutionsto clear its dev-only advisories.How can be tested?
What was run locally:
src:yarn lint && yarn build && yarn test(48 tests, including new ones for id validation and shell-free execution).ui_openvpn:yarn lint && yarn test && yarn build(4 tests, including a decrypt round trip against the backend's encryption scheme).masterimage on fresh volumes, added and revoked devices, and created a share link. Then started this image on the same volumes. Everything worked on the old PKI:ls,print,add,rm,reset, re-adding a previously revoked name, and the admin link persisted by the old image.client-connecthook marked the link as used, and a revoked certificate was rejected via the CRL..ovpnmatchedvpncli printbyte for byte./rpcare rejected, and ids with shell metacharacters that pass validation are handled literally.To reproduce the upgrade test: build the image, start it with the volumes of an existing install, then check
vpncli ls, connect an existing client, and add, reset and remove a device.Other notes for review
172.33.xnetwork) were not.REACT_APP_*→VITE_*; they are only used inside the Dockerfile.tests/Dockerfileis stale.