← Back to issue list

license: field in meta/snap.yaml is not validated store-side

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1862242
Type
issue
State
closed
Author
~sergiusens
Labels
Created
Updated
Closed

Current evaluation

Closed without resolution. The license validation gap in snapcraft and the store was not addressed in this thread and appears abandoned.

Suggested action:

No scores available.

Issue body

Snapcraft now supports the license: field, and it claims to verify the contents as a valid SPDX expression but ONLY if the `snap` command is available; this doesn't seem to work out of the box. If snapcraft is unable to validate the license, it will just upload the bogus-licensed snap to the store. The store also doesn't validate / ignores the license: field (i.e. we don't extract or verify licensing metadata from it, otherwise it would fail our license expression validation). As a result, it's perfectly possible for a snap with a bogus license: field to make it into the store. When trying to install such a snap, this happens: $ sudo snap install --edge hello-roadmr-1 error: cannot perform the following tasks: - Mount snap "hello-roadmr-1" (164) (cannot validate license "some really bogus license": unknown license: some) To repro this, given a working snapcraft setup and a registered snap name, use this snapcraft.yaml: name: hello-roadmr-1 version: 2020-02-06-04 summary: say hello to this snap which is ok confinement: strict grade: stable description: just a description. license: some really bogus license base: core18 architectures: - amd64 apps: hello: command: echo "hello" parts: empty: plugin: nil then snapcraft build, snapcraft push --release etc (the whole snap publishing shebang), then try to snap install it and you'll get the error I noted above. I noticed snapcraft says this at build time: Could not find '/snap/core/current/usr/bin/snap', validation of the license string will only take place once pushed to the store. which is strange because it also said this *prior* to that: Launching a VM. Launched: snapcraft-hello-roadmr-1 2020-02-06T20:58:24Z INFO Waiting for restart... snapd 2.42.5 from Canonical✓ installed core18 20200124 from Canonical✓ installed snapcraft 3.9.8 from Canonical✓ installed I notice it says /snap/core so probably it's looking for core16 (aka core) but since this is a clean core18-based build, the expected path does not exist

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed without resolution. The license validation gap in snapcraft and the store was not addressed in this thread and appears abandoned.
qwen/qwen3.6-35b-a3b Closed without resolution. The license field validation bypasses checks when the snap command is missing, and the store ignores the field. No fix was provided.
qwen/qwen3.6-35b-a3b Closed without resolution. Missing store-side validation for the snap.yaml license field allowed invalid licenses to be uploaded, causing install failures. Local validation also failed due to a hardcoded core16 path in core18 builds.
qwen3.6-35b-a3b-mtp-q6 Closed without explicit resolution. Local and store-side license validation bypasses allowed invalid SPDX expressions to be uploaded, causing installation failures. Superseded by updated Snapcraft and store validation logic.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1606283 license does not work in the snap installation. snapcraft (launchpad) closed Closed without discussion. The license field was deprecated in snapcraft, so the issue was abandoned or closed as wontfix. No fix was applied.
81%