繁體中文

問題修復

修復四處安全漏洞,防範非預期檔案寫入與驗證被繞過

下載、安裝技能或驗證產物時不再受惡意名稱所害,建議盡快升到 v2.102.0。gh release download、gh run download、gh repo read-file --output 與 gh attestation download 遇目的地含符號連結(指向其他位置的捷徑檔)時,以前可能寫入非預期的本機檔案。gh attestation verify 以前比對 --source-ref 不分大小寫,且 --signer-workflow 只比憑證身分開頭,僅大小寫不同的分支,或同儲存庫內路徑開頭相同的另一個工作流程,都可能通過驗證。互動式 gh skill search 傳路徑給 gh skill install 時缺少選項分隔符號,搜尋結果可能注入安裝選項並改寫檔案位置。

English

BUGFIX

Fix Four Security Vulnerabilities to Prevent Unexpected File Writes and Verification Bypasses

Downloading artifacts, installing skills, or verifying attestations is no longer vulnerable to malicious names, and upgrading to v2.102.0 as soon as possible is recommended. When the destination contains a symlink, gh release download, gh run download, gh repo read-file --output, and gh attestation download previously risked writing to unintended local files. gh attestation verify previously compared --source-ref case-insensitively and only matched the prefix of certificate identities for --signer-workflow, allowing branches differing only by case or another workflow with a matching path prefix in the same repository to pass verification. Interactive gh skill search lacked an option delimiter when passing paths to gh skill install, which allowed search results to inject installation options and alter file locations.

原始 CHANGELOG

Original changelog修復四處安全漏洞,防範非預期檔案寫入與驗證被繞過
## Security

Four security vulnerabilities have been identified, and fixed, in this release. Users are advised to update gh to version `v2.102.0` as soon as possible.

`gh release download`, `gh run download`, `gh repo read-file --output`, and `gh attestation download` could write remote content to an unintended local file when the destination contained symbolic links.

See https://github.com/cli/cli/security/advisories/GHSA-39wj-f2f4-978v for more information.

`gh attestation verify` compared the `--source-ref` value case-insensitively, so an attestation built from a branch whose name differs only in case could satisfy a policy that named a different branch.

See https://github.com/cli/cli/security/advisories/GHSA-4mq3-hpgx-9cx8 for more information.

Interactive `gh skill search` passed repository paths from search results to `gh skill install` without an option separator, so a search result could inject installer options and change where skill files were written.

See https://github.com/cli/cli/security/advisories/GHSA-qcwj-mr2r-2cx7 for more information.

`gh attestation verify` matched the `--signer-workflow` value against only the start of the signing certificate's identity, so an attestation signed by a different workflow in the pinned repository could pass verification when its path began with the pinned value.

See https://github.com/cli/cli/security/advisories/GHSA-wjmr-j3rp-mh2g for more information.