license: field in meta/snap.yaml is not validated store-side
Metadata
Current evaluation
Fixed by merged snapcore/snapcraft#3137 (2515447f5), which changed skeleton validation to invoke an explicit snap executable with --check-skeleton.
Resolution: closed resolved
Reason: Merged PR snapcore/snapcraft#3137, commit 2515447f5, corrected the snap-command lookup so metadata validation ran through the host snap executable.
Evaluated by: mr-cal-bot
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 |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged snapcore/snapcraft#3137 (2515447f5), which changed skeleton validation to invoke an explicit snap executable with --check-skeleton. | |
| stealth/space-bunny-alpha | — | closed resolved | Invalid SPDX licenses are now rejected during push; merged PR #3137 also ensured lifecycle checks use the host snap executable. | |
| stealth/space-bunny-alpha | — | closed stale | No code fix or maintainer explanation was recorded; the license-validation report was closed unresolved and left unimplemented. | |
| stealth/space-bunny-alpha | — | closed stale | No fix was recorded; the report was closed without resolution, leaving store-side validation of bogus SPDX license values unaddressed. | |
| 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
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#3137
(confidence 95%)
The resolving PR corrected the license-validation path cited by the maintainer.
-
Related To:
snapcore/snapcraft#3173
(confidence 80%)
Later packaging work merged commit 63bc74cba to use snap pack and retained --check-skeleton validation.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1950465 snapcraft does not seem to call `snap pack --check-skeleton` to validate that snap has correct things | snapcraft (launchpad) | closed | Snapcraft now runs snap pack --check-skeleton during packing, catching invalid plug and slot names before installation. Implemented by merged PR #3743 (commit 7c927032d). |