Repository navigation
Conversation
cargo-audit fails on every PR: zip 2.4.2 in elastos/Cargo.lock and in capsules/object-provider/Cargo.lock (through its elastos-server path dependency) has three advisories against ZipArchive::extract and the stream extract API. The runtime calls neither; it reads each entry itself. zip 9.0.4 is the patched release. - elastos-server uses zip 9.0.4, still without default features. 9.x has no separate flate2 feature; deflate-flate2 now enables the dependency. - Both lockfiles change only for zip: nix 0.31.3 and typed-path come in, derive_arbitrary goes. `cargo update -p zip` also moved unrelated range dependencies (windows-sys, getrandom); those lines stay as they were, and `cargo metadata --locked` accepts both files. - ZipFile::name now returns a Result. The ZIP readers report an error as "invalid ZIP archive entry". - Whole-archive extract keeps its rule for entry names. zip 9 enclosed_name turns "/a.txt" into "a.txt" and folds "x/../a.txt" into "a.txt", so an entry that extract refuses today would be written. The runtime now checks the name with the rule zip 2.x applied: no NUL byte, no root or drive prefix, no climb above the archive root. test_library_provider_extract_zip_refuses_absolute_dotdot_and_symlink_entries covers absolute, "..", inner "..", backslash and symlink entries. It passes on zip 2.4.2 and with this change, and fails on the Absolute.zip case when extract uses zip 9 enclosed_name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6Qn9RX7LDqrwiAfNC2F2K
…ase's Browser host access An earlier installer could run scripts/browser-vm-linux-network.py setup with sudo. That setup left a root-owned helper copy, a boot service, a KVM udev rule, a KVM ACL and private network devices for the account. Linux setup now removes only the user-owned Browser files, and nothing told the user that the root-owned access was still there. retire_host now checks this account's files read-only. When the helper and its access record are present, it prints the helper's own removal command. Otherwise it names the files that are left. Setup changes nothing outside the data directory and does not ask for sudo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6Qn9RX7LDqrwiAfNC2F2K
zip 9 for RUSTSEC-2026-0367/0368/0369 so cargo-audit passes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6Qn9RX7LDqrwiAfNC2F2K
The leftover Browser host access notice printed a sudo command when the helper copy and its access record merely existed. A file that another account can write, a link, or a link in a folder on the path could then put a command that runs that account's code as root in front of the user. The notice now checks each path with lstat, as the helper's own trusted_path does: the helper, its access record and /usr/bin/python3 (through root-owned links) must be root-owned regular files with no set-id bit and no group or other write, in real folders that only root can change. Otherwise the notice names the files and no command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6Qn9RX7LDqrwiAfNC2F2K
Contributor
Author
|
Generated by Claude Code |
Contributor
Author
|
Round 3 review: PASS (A). The sudo hint appears only when every path is root-owned; tests pass. |
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.
Summary
Earlier releases'
install.sh(prepare_browser_linux_host,scripts/install.sh:907-937ondevelop) could runscripts/browser-vm-linux-network.py setupwith sudo, aftersudo install -D -o root -g root -m 755of the helper (install.sh:925). That setup creates root-owned access for the account:/usr/local/lib/elastos/browser-vm-linux-network.py(mode 0755,browser-vm-linux-network.py:311),/etc/systemd/system/elastos-browser-network-<uid>.service,/etc/udev/rules.d/70-elastos-browser-kvm-<uid>.rules,/var/lib/elastos-browser/<uid>.json(mode 0644,write_json,browser-vm-linux-network.py:197-201; written inconfigure,:259-318).Browser is now unavailable on Linux (
browser_available,setup/browser_config.rs:166).retire_hostremoves the user-owned Browser files from the data directory, but it cannot reach the root-owned access, and nothing told the user it was still there.Change
Head:
4bf4b26a. Two commits on top ofdevelopplus the zip 9 merge (241ba6a7, from #417, socargo-auditcan pass):6ef7073d—retire_hostcallsearlier_linux_host_accesson Linux (setup/browser_config.rs:356-360). It only reads file metadata for this account's paths and changes nothing outside the data directory. It does not ask for sudo.4bf4b26a— the sudo command is printed only when every path it relies on is trusted (browser_config.rs:399-401):root_only_file,:438):lstat(no link followed), a regular file, owned by uid 0, no set-id or sticky bit, no group or other write;/(root_only_folders,:424): a real folder, not a link, owned by uid 0, no group or other write;/usr/bin/python3(root_only_program,:450): followed through at most 8 links, each owned by uid 0 in such folders, with no..in a link target, to an executable regular file with the same rules.This is the rule of the helper's own
trusted_path(scripts/browser-vm-linux-network.py:113-117:st_uid != 0,st_mode & 0o022,S_ISLNK, for the file and every parent), plus the regular-file and no-set-id checks.Then setup prints the helper's own removal command (the same command
install.sh:936printed):In every other case (a missing or untrusted helper, access record or interpreter) it fails closed: it prints a plain note naming this account's leftover files and "An administrator can remove these files", with no command.
The trusted owner is a parameter (
earlier_linux_host_access(root, uid, owner),:384); production passesROOT_UID(0), so tests run both as root and as an ordinary user.Tests
All in
setup/browser_config.rs, Linux only, on a fake root (earlier_linux_host_layout,:1071: folders 0755, helper and interpreter 0755, access record 0644,usr/bin/python3 -> python3.12):earlier_linux_host_access_names_its_exact_removal_command(:1132): fresh host and another account's files give no notice; this account's trusted files give the exact command and stay in place; a missing access record or helper gives a file list withoutsudo.earlier_linux_host_access_names_no_sudo_command_for_files_root_does_not_own(:1168): as root, each of the helper,/usr/local/lib/elastos,/usr/local, the access record,/var/lib/elastos-browser,/usr/bin/python3(link,lchown),/usr/bin/python3.12,/usr/binand/in turn is given to uid 1000 and the command disappears. As a non-root user (CI) the test's own files are ordinary user files and give no command with owner 0; the per-pathchowncases are skipped with a message, because only uid 0 can give a file away. Both: files whose owner is not the trusted owner give no command.earlier_linux_host_access_names_no_sudo_command_through_a_link(:1212): helper link, access-record link, helper folder link, higher folder (/usr/local) link, interpreter link with.., interpreter link loop.earlier_linux_host_access_names_no_sudo_command_for_a_wrong_type_or_mode(:1262): helper or access record is a folder; helper 0775, 0757, 04755; access record 0666; helper folder 0777; interpreter 0644;/usr/bin0775.Negative proof. I reverted the check at
browser_config.rs:399-401to the6ef7073dcondition (helper.is_file() && state exists) and ran the tests as root:(The old code already refused a helper that is a link or a folder.) With the fix restored, as root and as uid 65534 (
setpriv):cargo clippy -p elastos-server --lib --tests -- -D warnings,cargo fmt --all -- --checkandgit diff --checkare clean.Gaps
sudo, only root can change the checked paths (they are root-owned in root-only folders), and the helper'sremovere-checks its access record withtrusted_json(browser-vm-linux-network.py:272)./usr/localor/usr/local/libis group-writable (for example an old Debianroot:staff 2775layout), the notice gives no command. That matches the helper's owntrusted_path, which refuses that layout too./usr/bin/python3is not checked to be Python; it is checked to be a root-owned executable that only root can change.elastos setupuntil the access is removed.Generated by Claude Code