Repository navigation
security: bump axios to 1.18.1 and harden Tauri spawn_api_process - #15336
Merged
remibettan merged 5 commits intoJul 5, 2026
Merged
Conversation
Bump `axios` from 1.16.0 to 1.18.1 (npm latest) in the react-viewer, picking up upstream security-relevant fixes released since 1.16.0: - 1.17.0: own-property guards on socketPath, params, and paramsSerializer reads (prototype-pollution -> SSRF hardening). - 1.18.0: strip caller-specified sensitive headers on cross-origin redirects (prevents API-key leak); reject malformed http(s) URLs missing "//". - 1.18.1: make AxiosError#cause non-enumerable to avoid circular JSON failures; guard socket.setKeepAlive for proxy-agent streams. Also add path and port sanity checks at the top of spawn_api_process in src-tauri/src/main.rs so a missing, relative, or privileged-port misconfiguration fails fast with a clear error instead of surfacing as a downstream Command::spawn failure. Command::new(path) execs the binary directly with no shell, so this is defense-in-depth against misconfiguration, not shell-injection mitigation.
sysrsbuild-gh-agentic
left a comment
Collaborator
There was a problem hiding this comment.
🤖 Automated review by rs-agentic bot
Reviewed PR #15336 against the copilot-instructions guidelines. Found 2 bugs and 2 enhancement notes inline. Additionally:
- Missing
package-lock.json: see inline comment onpackage.json. - No tests for the new
spawn_api_processvalidation logic. The function is gated by#[cfg(not(debug_assertions))]which makes unit-testing harder, but an integration/smoke test or a dedicated#[cfg(test)]helper that calls the validation path with bad inputs and asserts the expectedErrvariants would be a clear improvement and is consistent with the project's testing culture.
See inline comments for details.
Replace separate exists() + is_absolute() checks with a single canonicalize() call. This resolves the regression where the relative PathBuf fallbacks returned by find_api_executable (e.g. "realsense_api/...", "../build/tauri-resources/...") would be rejected by the is_absolute() guard, breaking the dev/release fallback path. Also expand the privileged-port error to explain the accepted range.
Re-run of `npm install` in wrappers/rest-api/tools/react-viewer/ to keep package-lock.json in sync with the axios bump in the previous commit. Only the axios entry changes (version, resolved URL, integrity).
Nir-Az
self-requested a review
July 2, 2026 12:41
Nir-Az
approved these changes
Jul 2, 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.
Overview
Alternative to #15321. Same intent — bump
axiosin the react-viewer and tighten the Taurispawn_api_processguardrails — with corrected version pin, accurate fix notes, and cleanup of a tautological check and a misleading comment.Changes
wrappers/rest-api/tools/react-viewer/package.json— bumpaxios1.16.0→1.18.1(npmlatest).Fixes picked up on the way:
socketPath/params/paramsSerializerreads (prototype-pollution → SSRF hardening).http(s):URLs missing//.AxiosError#causenon-enumerable to avoid circular JSON failures; guardsocket.setKeepAlivefor proxy-agent streams.Note on #15321: the two CVEs cited there (CVE-2026-44494, CVE-2026-44492) were both already fixed in
1.16.0, so they don't apply to what we were pinned at. The real reasons to bump are the fixes above.wrappers/rest-api/tools/react-viewer/src-tauri/src/main.rs— add path/port sanity checks at the top ofspawn_api_process:pathpathport(< 1024)Framing note (vs. #15321):
Command::new(path)in Rust does not invoke a shell — itexecves the binary directly with no argv parsing — so this is defense-in-depth against misconfiguration, not shell-injection mitigation. The comment is worded accordingly.Also dropped the
port > 65535branch from that check:port: u16already caps at 65535, so the comparison is unreachable (andrustcmay warnunused_comparisons).Type