Skip to content

fix(bundler): reject non-string catalog entry tag members - #4318

Open
Noor-ul-ain001 wants to merge 1 commit into
github:mainfrom
Noor-ul-ain001:fix/catalog-tags-non-string-members
Open

fix(bundler): reject non-string catalog entry tag members#4318
Noor-ul-ain001 wants to merge 1 commit into
github:mainfrom
Noor-ul-ain001:fix/catalog-tags-non-string-members

Conversation

@Noor-ul-ain001

Copy link
Copy Markdown
Contributor

Summary

  • _parse_tags in src/specify_cli/bundler/models/catalog.py validates that a catalog entry's tags field is a list/tuple, but then silently coerces each member with str(t) for t in value — so tags: [1, true, {}] becomes ("1", "True", "{}") instead of being rejected.
  • This is the same bug class just fixed in fix(bundler): reject non-string manifest list members #4091 for the manifest's _parse_str_list (src/specify_cli/bundler/models/manifest.py), which rejects non-string list members with '{field}' must be a list of strings. The catalog's _parse_tags sibling wasn't updated in that PR, even though catalogs are explicitly untrusted input (per its own docstring).
  • Fix: reject any non-string member the same way the manifest fix does, instead of silently coercing it.

Test plan

  • Added test_catalog_entry_rejects_non_string_tag_members to tests/contract/test_catalog_schema.py, mirroring the existing test_catalog_entry_rejects_string_tags.
  • Verified the new test fails without the fix (DID NOT RAISE BundlerError) and passes with it.
  • Ran tests/contract/test_catalog_schema.py — 21 passed; the remaining 22 errors are pre-existing Windows tmp_path/PermissionError: WinError 5 environment failures unrelated to this change (reproduced on an unmodified checkout).

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FW9fAYsCBCAgdKWovtSyqt

@Noor-ul-ain001
Noor-ul-ain001 requested a review from mnriem as a code owner August 25, 2026 14:45
_parse_tags in bundler/models/catalog.py rejected a non-list `tags`
value but silently coerced individual non-string members via
`str(t) for t in value`, letting a catalog entry like
`tags: [1, true, {}]` through as `("1", "True", "{}")` instead of
raising. This is the exact sibling of the bug just fixed for the
manifest's `_parse_str_list` in github#4091 (bundler/models/manifest.py) —
same file family, same shape, just not swept across both call sites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW9fAYsCBCAgdKWovtSyqt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant