打包、许可证、版本和安全加固需要整理 [AI Review]

Open
#3,824 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
bash, csharp, linux, macos

Research direction

Start by reading the cited packaging scripts, release-publish.yml, metadata.json, and the referenced C# files; then map each proposed fix to its release or security checks. The issue spans licensing, version consistency, signing, checksums, archive validation, path safety, and provenance across platforms. Done means every acceptance criterion passes, including tests for Linux and macOS path and pipe checks.

Written by the indexing model from the issue text.

Description

⭕ 等待处理

🤖 这条 Issue 由 AI 代码审计批量生成,未经人工逐项复核。基线:dev@2856c2a4(迁移范围 9c4f1544..2856c2a4)。证据来自静态代码分析,欢迎在评论中补充或纠正。

现象

打包流程能生成各平台产物,许可证、版本号、产物校验和安全边界还有几处缺口。

证据

  • scripts/package-linux.sh:135 写的是 license: MIT。仓库根目录是 Apache-2.0,PCL.Launcher/ 和 PCL.Launcher.Core/ 使用自定义 PCL 许可。
  • PCL.Launcher/Resources/metadata.json:35-44,107,131-134,179 仍列 DotNet.Glob、Downloader、Markdig.Wpf、Stun.Net;MiniAudioEx 写 3.3.7,项目实际使用 4.0.1。
  • PCL.Launcher/PCL.Launcher.csproj:18-21、metadata.json:4-7 与发布 workflow 的 version 输入没有同步校验。
  • package-macos.sh:133-163 在缺少证书或公证凭据时会使用 ad-hoc 签名并跳过公证,发布流程不会报错。
  • release-publish.yml:111-122 只有 Sigstore,没有 SHA256SUMS。
  • scripts/verify-artifact.sh:9-50 只在打包前检查发布目录,不解包检查 zip、dmg、deb、rpm。
  • package-linux.sh:101-109 没有声明 Wayland 依赖,但代码会在 Wayland 会话默认使用 Wayland。
  • publish.sh:10 默认 $HOME/.dotnet/dotnet,其他脚本使用 dotnet 或 command -v dotnet。
  • PCL.Core/IO/PipeComm.cs:126-150 在 macOS 上不做管道对端校验。
  • PCL.Core/IO/Files.Archive.cs:381-391、PCL.Launcher.Core/LauncherCommon.cs:511-514 使用 OrdinalIgnoreCase,在 Linux 上可能被大小写变体绕过。
  • PCL.Launcher.Core/Install/LoaderInstallerInstall.cs:650-663 和 PCL.Launcher.Core/Launch/Natives.cs:50-76 解压时没有统一检查目标路径。
  • PCL.Core/App/Essentials/BuildProvenance.cs:55-82 用可执行文件哈希对比发布压缩包摘要,正式版会被判定为不可信。

影响

包管理器显示的许可证不正确。版本号可能和程序内显示不一致。macOS 发布可能在未签名、未公证的状态下发出。归档解压存在路径逃逸风险。

建议

  • 许可证改成 Apache-2.0 加自定义许可的组合,或按包内容分别声明。
  • metadata.json 和 csproj 版本从同一处生成,发布前校验。
  • macOS 正式发布缺少签名或公证凭据时直接失败。
  • 发布 SHA256SUMS,打包后解包检查关键文件。
  • deb/rpm 增加 Wayland 依赖。
  • macOS 管道增加 LOCAL_PEERCRED 校验。
  • 路径包含检查按平台选择大小写规则。
  • 归档解压统一走安全路径检查。
  • BuildProvenance 改为校验发布清单或 Sigstore 证明。

验收

  • 包管理器和关于页显示的许可证、版本一致。
  • macOS 正式包通过签名和公证检查。
  • 每个发布产物都有校验和和解包检查。
  • Linux 和 macOS 的路径、管道安全检查通过测试。
Dominant language
C#
Stars
4.3k
Forks
148
Avg merge
1d 6h
Merged PRs (30d)
64

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PCL-Community/PCL-CE

All issues in PCL-Community/PCL-CE

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.