← Back to issue list

snapstore and review-tools use the wrong regexp for snap names

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1751447
Type
issue
State
closed
Author
~chipaca
Labels
—
Created
Updated
Closed

Current evaluation

Snap-name validation was fixed by merged PR snapcraft#1957 (commit b950c66a2), removing exponential regex behavior, enforcing the 40-character limit, and improving errors.

Resolution: closed resolved

Reason: PR #1957 was merged as commit b950c66a2. It replaced the problematic snap-name validator with safer validation and a clear length limit.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The agreed-upon regexp for snap names is ^(?:[a-z0-9]+-?)*[a-z](?:-?[a-z0-9])*$ with a maximum length of 40. (which translates to: snap names must be made of ascii letters and numbers, and the hyphen, but hyphens must be surrounded by letters or numbers). Snapcraft and snapd both use this regexp for validating snap names; a snap with a name that doesn't match this will fail to install. However, today, you can happily register a snap called "1024", or "10-10". As far as I can tell neither review-tools nor the store will stop you from publishing this.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Snap-name validation was fixed by merged PR snapcraft#1957 (commit b950c66a2), removing exponential regex behavior, enforcing the 40-character limit, and improving errors.
stealth/space-bunny-alpha — closed stale Closed as stale after inactivity; no fix landed in snapstore or review-tools. snapcore/snapcraft#1957 only added related Snapcraft validation coverage.
stealth/space-bunny-alpha — closed stale LP#1751447 was closed as stale after inactivity. No fix landed in snapstore or review-tools to correct snap-name validation and reject names such as 1024 and 10-10.
qwen/qwen3.6-35b-a3b — — Closed and abandoned due to inactivity. The snapstore and review-tools retain an incorrect regex for snap name validation, permitting invalid names. No fix or follow-up was implemented.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The snapstore and review-tools regex validation for snap names was never updated, allowing invalid names like "1024" to be registered.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The snapstore and review-tools regex validation for snap names was not corrected, likely abandoned due to prolonged inactivity.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution or comments, likely abandoned. The regex mismatch allowing invalid snap names in snapstore and review-tools remains unaddressed.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#1957 (confidence 99%)

    Merged PR updating the snap-name schema validator and directly linked in the issue.

Related issues

Issue Project State Summary Similarity
#1957 schema: improve the snap name's validator snapcraft merged Merged as b950c66a2: snap-name validation now avoids exponential regex behavior, enforces the length limit, and provides clearer errors.
76%
#1763048 Snap names regexes are inconsistent or too permissive snapcraft (launchpad) open Cross-project request to make snap-name validation consistent (no one-char names, no leading/trailing/double dashes). Resolved upstream: snapd added the min-length-2 check (snapd PR #6154, commit 362784dc); tracker marked fix released in 2019 but bug still shows open.
71%
#1589613 Snap app names are too permissive snapcraft (launchpad) closed Fixed: snapcraft PR #555 (commit bc9fac7e7) tightened snap/app name validation to match snapd, with snapd PR snapcore/snapd#1280; shipped in snapcraft 2.12 (xenial/yakkety) and verified.
70%