OpenSSL config path does not respect open_basedir restriction
还没有人认领这个 Issue。
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
Currently the config in options passed to some functions is not checked if it is inside open_basedir restriction. This should be probably fixed just in master as it is not usually a big issue considering that the config is basically read only and some user flows might have relied on it being in the system path so we don't want to break them in a patch release. However we should still confirm to the open_basedir rules and prohibit it in master branch. One thing to note that this should not be applied on the default path as it would be too big break for not a big gain.
The following code:
<?php
// cert path (existing cert)
$config= "$file_path/openssl.cnf";
ini_set('open_basedir', "$file_path/config");
$pkey= openssl_pkey_new([
'config' => $config
]);
var_dump($pkey);
Resulted in this output:
object...
But I expected this output instead:
possibly warning
bool(false)
PHP Version
Any
Operating System
Any
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 openssl_pkey_new() 入口点开始,跟踪其显式 'config' 选项在 open_basedir 下的处理方式。验证限制范围之外的配置路径会被拒绝,而默认路径不受影响,然后为这两种情况添加回归测试覆盖。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, php
- 领域
- security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100