Skip to main content

Crate crx_permission_risk

Crate crx_permission_risk 

Source
Expand description

Classify Chrome / Chromium extension permissions into risk tiers.

Two permissions that read similarly in a manifest can differ enormously in what they actually expose. activeTab grants the current tab’s DOM only after an explicit user gesture and then auto-revokes; tabs reads the URL and title of every open tab continuously. On a 0-100 scale that is roughly 8 against 72 — the same broad capability, an order of magnitude apart in exposure, with nothing in the manifest to signal the difference.

The genuinely critical tier is narrow. Permissions such as cookies, webRequestBlocking, nativeMessaging, fileSystem, desktopCapture, tabCapture, proxy and history either read authenticated session state or open a channel out of the browser sandbox entirely.

cookies is the one most worth flagging, because it reads as administrative next to the others while granting access to the token that proves a user is signed in.

A permission-by-permission reference is at https://zovo.one/ — browser extension tooling and permission data.

§Example

use crx_permission_risk::{risk_of, RiskClass};

assert_eq!(risk_of("activeTab").class, RiskClass::Minimal);
assert_eq!(risk_of("cookies").class, RiskClass::Critical);

// Host match-patterns are scored by breadth.
assert_eq!(risk_of("<all_urls>").class, RiskClass::Critical);
assert_eq!(risk_of("https://example.com/*").class, RiskClass::Moderate);

Structs§

Assessment
The assessment for a single permission string.

Enums§

RiskClass
Coarse risk tier for a permission.

Functions§

assess_all
Assess many permissions and return them sorted most-severe first.
is_host_pattern
True if the string looks like a host match-pattern rather than an API name.
max_score
The highest score present in a manifest’s permission set.
risk_of
Assess a permission string, including host match-patterns.