Skip to content

function-wasm-v1.0.2

Choose a tag to compare

@jonasz-lasut jonasz-lasut released this 13 Nov 14:51
· 4 commits to release-function-wasm-1.0 since this release

Caution

This is a security release, and every installation of 1.0.0 or 1.0.1 whose operator policy has a requireSignature rule should upgrade. An HTTP module whose URL had user information or a path that isn't normalized was loaded without the signature the policy requires. After the upgrade such a URL is refused under a policy with a requireSignature rule, and an HTTP source's manifestURL and manifestDigest are refused unless set together. Read "Before you upgrade".

function-wasm 1.0.2 closes a way around an operator's signature requirement and tightens two checks on what a request specifies. The flags, the manifest and the world are unchanged, and a module built for 1.0.0 runs without a rebuild.

Before you upgrade

Check HTTP module sources where the operator policy requires signatures. Under a policy with any requireSignature rule, a module.http.url with user information (https://user@host/…) or with ., .. or empty segments in its path is now refused:

module.http.url "https://modules.example.org/dev/../prod/fn.wasm" must have a normalized path (no . or .. segments, no empty segments): the operator policy requires cosign signatures by location (requireSignature), and this one cannot be read

Write the URL without them. Under a policy with no requireSignature rule, and with no policy file, these URLs work as before.

Check HTTP sources that specify a manifest. An Input with module.http.manifestURL and no module.http.manifestDigest, or the digest without the URL, is refused at admission with module.http.manifestURL and module.http.manifestDigest must be set together. On 1.0.1 a digest alone was ignored. Run function validate over your Compositions with the new version to find them.

Security

A signature requirement didn't hold for some HTTP URLs

The runtime asks the operator policy whether a module must be signed by the module's location. For an HTTP source the location is the URL as scheme://host/path, read only from a URL with no user information and a normalized path. Where the URL was written another way, no location was read, and the runtime took the source for one the requireSignature rules don't cover. That let a Composition author load an unsigned HTTP module from a location where the operator requires a signature. A module chosen by a composite resource through module.from wasn't affected, because such a URL is refused there.

In 1.0.2 a source whose location can't be read is held to the rules: it's required wherever the policy has a requireSignature rule, and since only OCI modules can be signed, it's refused with a sentence that says what is wrong with the URL (Signatures, #369).

Fixes

A manifest URL and its digest come together

The input reference says module.http.manifestDigest is required with module.http.manifestURL and refused without it, and nothing enforced that for a source written in the Input. Admission now refuses one without the other, a manifestURL that isn't an http or https URL and a manifestDigest that isn't sha256: followed by 64 hex characters (Input reference, #369).

An oversized gRPC timeout

A grpc-timeout header with a value past what gRPC allows overflowed the deadline calculation and failed the request in the handler. The runtime now reads such a value as no deadline, and the run is bounded by limits.timeout and --module-timeout as usual (#369).

World, Wasmtime and WASI versions

Serves guestfn:function@1.0.0 on Wasmtime 50.0.1: WASI 0.2.12 (cli, clocks, http, io) for the sync scaffolds and WASI 0.3.0 (cli, clocks, http) for the rust scaffold. Nothing here moved since 1.0.0.

Merged pull requests

Full changelog: function-wasm-v1.0.1...function-wasm-v1.0.2