init and serve leave an existing TLS private key readable by other users
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 crates/app/src/serve_helpers.rs(约第 77 行)中的 check_config_permissions 开始,它已经会发出警告并将配置设置为 0600;请对 server.tls.key_path 采用相同的做法。init 中的跳过路径是 crates/app/src/init_helpers.rs 中的 generate_tls_cert_if_needed。当一个从 0644 密钥开始的测试显示了警告,并且最终密钥为 0600 时,在 serve 和 init 中都完成。
由索引模型根据 Issue 内容生成。
描述
Problem
Neither init nor serve checks the mode of an existing TLS private key, so a key.pem that other users can read stays readable.
initskips certificate generation when bothcert.pemandkey.pemexist (generate_tls_cert_if_needed,crates/app/src/init_helpers.rs). It checks that the certificate covers the requested names and does not look at the key's mode.servechecks only the config file's mode:check_config_permissions(crates/app/src/serve_helpers.rsline 77) warns and sets the config to 0600 when group or other bits are set. Read from the code, nothing does the same forserver.tls.key_path(default~/.extenddb/tls/key.pem).
A key ends up wider than 0600 when an older init stopped between writing the key and setting its mode (#709, fixed in #766 for new keys), or when an operator copies a key in with the umask mode.
Measured
2 November 2026, a build of #766 (7cb517498), a fresh HOME, umask 022. init created key.pem at 0600. After chmod 0644 key.pem, a second init with a new config path and a new SQLite path printed --- TLS certificate already exists, skipping generation., exited 0, and left key.pem at 0644.
Expected
Treat the key file as check_config_permissions treats the config: when server.tls.key_path has group or other bits set, serve warns and sets it to 0600, and the init skip path does the same for ~/.extenddb/tls/key.pem. A test starts from a 0644 key and checks the warning and the 0600 result.
- 主要语言
- Rust
- 星标
- 517
- 派生
- 60
- 平均合并
- 4 天 19 小时
- 30 天内合并 PR
- 50
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ExtendDB/extenddb 的其他 Issue
-
Scan: ExpressionAttributeValues without an expression answers with a ": FilterExpression is null" suffix the service does not send可能已有人在做 @LeeroyHannigan 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
ExtendDB/extenddb#722 · 已指派 1 人 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
init writes the TLS private key at the umask mode before setting it to 0600可能已有人在做 @LeeroyHannigan 今天认领。 未关闭bug security
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 4 天内回复
-
Export and import paths can write CR, LF and terminal escape sequences into the server log可能已有人在做 @LeeroyHannigan 今天认领。 未关闭bug security
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 4 天内回复
-
extenddb version prints the first build's commit after a rebuild in the same target directory可能已有人在做 @LeeroyHannigan 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 4 天内回复
查看 ExtendDB/extenddb 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
GiganticMinecraft/seichi-portal-backend#1651 ·
维护者通常 1 天内回复
-
Android visitors are offered the Linux .deb on cap.so's homepage and download page可能已有人在做 @patrickballard 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
CapSoftware/Cap#3677 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复