T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/install_extension_policy.sh:27
- Finding
- System-Wide Forced Extension Installation Exceeds the Required Profile Scope<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install_extension_crx.sh:88-100`; `scripts/install_extension_policy.sh:27-38,56-62`; `SKILL.md:36-39` **Vulnerability Type**: Least-privilege violation through system-wide managed browser policies **Risk Level**: High ### Vulnerable Code ```bash # scripts/install_extension_crx.sh:88-100 echo "[4/6] Installing external extension files ($BROWSER)" sudo mkdir -p "$EXT_BASE_DIR" sudo cp "$CRX_PATH" "$EXTERNAL_CRX_PATH" EXT_VERSION="$(python3 - <<PY import json from pathlib import Path m = json.loads(Path('$UNPACK_DIR/manifest.json').read_text()) print(m.get('version','0.0.0')) PY )" printf '{"external_crx":"%s","external_version":"%s"}\n' "$EXTERNAL_CRX_PATH" "$EXT_VERSION" | sudo tee "$EXTERNAL_JSON_PATH" >/dev/null ``` ```bash # scripts/install_extension_policy.sh:27-38 if [ -n "$EXT_ID" ]; then cat <<EOF | ${SUDO} tee "$file" >/dev/null { "ExtensionInstallSources": [ "https://chrome.google.com/*", "https://clients2.google.com/*", "https://chromewebstore.google.com/*" ], "ExtensionInstallForcelist": [ "${EXT_ID};${UPDATE_URL}" ] } EOF ``` ```bash # scripts/install_extension_policy.sh:56-62 # Debian/Ubuntu Google Chrome + Chromium package locations write_policy_file "/etc/opt/chrome/policies/managed" write_policy_file "/etc/chromium/policies/managed" # Chromium Snap common managed policy paths used in many headless/server setups write_policy_file "/var/snap/chromium/current/policies/managed" write_policy_file "/var/snap/chromium/current/chromium-browser/policies/managed" ``` ### Technical Analysis The declared operation is to install DataHive in the dedicated browser profile named `datahive`. The implementation instead requests administrative privileges and writes managed browser policies into four system-level Chrome and Chromium locations. `ExtensionInstallForcelist` instructs supported browsers to install and retain the extension as a managed component. Users may ...[truncated 1798 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Use a user-scoped installation mechanism restricted to the dedicated `datahive` profile. 2. Do not write managed policy unless it is strictly necessary and the user has explicitly consented to a system-wide forced installation. 3. If managed policy is unavoidable: - Write policy only for the browser selected through `BROWSER`. - Do not write policy for both Chrome and Chromium. - Restrict the extension ID to the documented DataHive ID. - Clearly disclose that the extension will be managed and may affect every profile. 4. Add a rollback script that removes: - The installed CRX and external-extension JSON file. - Every policy file created by the installer. 5. Back up pre-existing policy state and restore it during rollback rather than blindly deleting files. 6. Verify effective policy scope after installation and fail if profiles other than `datahive` are affected. ]]>
