Skip to content

S07-12 - Dependency Gate

Purpose: How wb-proxyd keeps young and vulnerable package versions from the guest on the gated registries.

This page serves SEC07-dep-gateSEC07-dep-gate: Dependency gatePackage downloads (npm, PyPI, Go modules, crates) are refused when the version is younger than a minimum age or has a known vulnerability at or above a severity threshold.. For npm, PyPI, the Go module proxy and crates.io, wb-proxyd looks up each version’s publish time and known vulnerabilities (OSV data). Publish times are on their own page, S07-13-publish-timeS07-13-publish-time: Publish TimeWhere the dependency gate gets each version's publish time, and how it builds a clock for Go modules from the checksum database..

The minimum age is 7 days by default. It is applied twice, to metadata and to downloads.

Versions younger than the minimum age are removed from the registry’s metadata responses. A resolver then picks an older version. This covers:

  • npm packument versions and dist-tags, with latest moved to the newest remaining release;
  • npm /-/package/<name>/dist-tags, filtered like the packument’s dist-tags;
  • the PyPI JSON simple index (PEP 691);
  • crates.io sparse index lines;
  • Go @v/list and @latest.

For PyPI:

  • The PyPI JSON API (/pypi/<name>/json, which Poetry reads) loses its young releases.
  • When that response’s info describes a young release, the response is refused.
  • A PyPI client that doesn’t accept the JSON simple index is refused.

A download is refused when the version is younger than the minimum age, or has a known vulnerability at or above the threshold. The error names the package, the version, its publish time, and the date it becomes allowed.

On the gated hosts this catches lockfile pins, which never fetch metadata.

For the Go module proxy, only .zip is a download.

The default threshold is CRITICAL (I73I73 (closed): S07-egress-gateway: vulnerability threshold of the dependency gateFound by the X21-dep-gate-registries spike (#32).).

The severity is the record’s database_specific.severity. Where that is missing, wb-proxyd scores the record’s CVSS vector.

  • A record with no severity at all is allowed, and logged with the rule vuln-no-severity.
  • A failed lookup is still refused.

The gate covers the registry hosts above, and nothing else. The same packages fetched another way are not gated:

  • Go with GOPROXY=direct, or GOPRIVATE from a git host;
  • git+https: and github: dependencies;
  • archive downloads from a git host (codeload.github.com);
  • cargo git dependencies;
  • mirrors such as registry.npmmirror.com, goproxy.cn or an Artifactory server.

That residual is T07-ungated-sourcesT07-ungated-sources: Dependencies from ungated sourcesThe dependency gate (SEC07-dep-gate) covers the npm, PyPI, Go module proxy and crates.io hosts only.. These rules narrow it:

  • the git hosting profile denies archive downloads;
  • the approval risk check flags a host that mirrors a gated registry.

Each gated host accepts only explicit path forms:

Registry Path form
npm a package name and tarball
PyPI a PEP 503 project name, with a PEP 440 version in a distribution file name
Go module proxy an escaped module path, with a semantic or pseudo-version
crates.io a crate name, with a semantic version

A request that fits none of them gets a 403 that names the rule.

The gate identifies a package by its percent-decoded name. So /@scope/name, /@scope%2fname and /@scope%2Fname get the same decision. A request on a gated host whose package can’t be identified is refused.

  • Parsed names and versions are validated before they go into a lookup URL or an OSV query.
  • A download is mapped from its URL alone.
  • A PyPI file name is checked against the project’s JSON API.

The Go module proxy answers a .zip request with a redirect. wb-proxyd follows it itself, one hop, and only to https://storage.googleapis.com/. Any other Location is refused and logged with the rule. So the redirect can’t reach the host, the LAN or another site (SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable.).

OSV is queried while the download runs. No byte of the body reaches the guest before the verdict.

OSV answers are cached for one hour, keyed on package, version and threshold. During an OSV outage, only answers less than an hour old are used. Every other download is refused. A malicious-package report published within that hour can be missed.

If the publish time can’t be found or a lookup fails, the request is refused (fail closed).

Per-project overrides are explicit and audited. They apply to the whole VM while the project has a session in it (S07-01-per-vm-policyS07-01-per-vm-policy: Enforced per VMWhy the VM is the unit the gateway enforces, how the policies of its projects combine, and what happens when they conflict or change.).

Each filtered metadata response is an audit event, with the package, the versions hidden and the rule min-age (SEC10-auditSEC10-audit: AuditEvery egress decision, approval, and returned change is recorded on the host in a persisted log the guest cannot alter.). wb status shows it. So a package with only young versions reads as too new, and not as a typo (NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.).

On gated metadata requests, wb-proxyd removes If-None-Match and If-Modified-Since. A rewritten body goes out without ETag or Last-Modified.

The gate fetches publish times itself, before credentials are injected. So a package on a private registry fails closed. How the gate authenticates its own fetch is open (B32-dep-gate-registriesB32-dep-gate-registries: Can the dependency gate refuse young packages without breaking installs?Yes, with conditions.).

Bottles are not gated (T08-homebrew-ungatedT08-homebrew-ungated: Young Homebrew bottlesHomebrew bottles from homebrew/core are not age-gated or checked against OSV.).

Casks (homebrew/cask) are outside the ghcr.io scope in V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there.. So brew install --cask raises an approval prompt for the host its download comes from.

The gate implements OpenShell’s supervisor middleware API (SupervisorMiddleware, RFC 0009). It runs inside wb-proxyd, after policy allows a request and before credentials are injected. So it never sees a credential.

The gate implements the Go interface generated from supervisor_middleware.proto (package openshell.middleware.v1, OpenShell v0.1.2, S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice.). wb-proxyd calls it as a Go method, with no listener and no gRPC hop (X24-openshell-artifactsX24-openshell-artifacts: OpenShell artifactsDo the OpenShell parts that S07-egress-gateway, S09-policy-credentials-audit and S10-tech-stack build on exist in the assumed form, under a permissive license, at a version that can be pinned: the networkpolicies sche…).

  • Download checks use EvaluateHttpRequest.
  • The metadata filter uses the messages of the HttpResponsePreReturn service, which the spike didn’t exercise.
  • An error returned by a gate method is a refusal.

OpenShell’s own proxy doesn’t offer a middleware the body of a compressed response. It doesn’t pass a middleware’s free-form deny reason to the client either. Those limits belong to OpenShell’s caller, not the API.

wb-proxyd is the caller here. So it writes its own refusal message. It decodes metadata before filtering, under these rules (SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped.):

The gate filters young versions out of metadata, and refuses young downloads, with the three PyPI rules above.

T07-ungated-sourcesT07-ungated-sources: Dependencies from ungated sourcesThe dependency gate (SEC07-dep-gate) covers the npm, PyPI, Go module proxy and crates.io hosts only. is accepted, with the two rules of “Scope”. So is a malicious-package report missed within the hour an OSV answer is cached (“Holding the body”).

  • Why: Homebrew offers one version per formula, and signs its formula metadata. So there is nothing to filter, and no older version to fall back to. OSV has no Homebrew data. With a 7-day minimum age, about a third of the most installed formulae would be refused.

Status: Draft