Tinacms
Tina: Code injection via unescaped Git branch name in generated client source
Tina is a headless content management system. Prior to 3.0.0, @tinacms/cli reads Git branch values from VERCEL_GIT_COMMIT_REF, GITHUB_BRANCH, or HEAD, incorporates the raw value into the API URL, and interpolates that URL into JavaScript string literals in packages/@tinacms/cli/src/next/codegen/index.ts and packages/@tinacms/cli/src/next/codegen/codegen/plugin.ts. A crafted Git-valid branch name containing a quote can terminate the generated string and inject an expression that executes when the generated client module is imported during a preview build. The injected code runs with the build process privileges and can read environment credentials, modify deployment artifacts, or make network requests. This issue is fixed in version 3.0.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.0.0
Fixed in 3.0.0
- < 3.0.0
Fixed in 3.0.0
Mitigation
Upgrade tinacms to 3.0.0 or later.
Upgrade cli to 3.0.0 or later.
References
- Vendor advisory github.com/tinacms/tinacms/security/advisories…
- Patch github.com/tinacms/tinacms/pull/7526
- Patch github.com/tinacms/tinacms/commit/d030d414d39e…
1 more
- Release notes github.com/tinacms/tinacms/releases/tag/@tinac…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.