已关闭
[Bug-Report|缺陷反馈]: 通过 ASCEND_CUSTOM_OPP_PATH 构造 dlopen 路径潜在导致任意动态库加载 #2054
P1GGYii创建于 4月24日关闭于 5月23日
4月25日 将 wang-minbo 设为负责人
wang-minbo
4月25日 评论:
4月25日 评论:
您好,我们计划增加realpath校验;但是experimental目录下的文件开放给社区用户开发,用户拥有非常大的自由度,无法进行白名单和文件管控


4月28日 关联了看板:Transformer
4月28日 将 yayahello 设为负责人
wang-minbo
5月7日 评论:
5月7日 评论:
此问题正在处理中,计划本周闭环


5月23日 关闭了 issue
5月23日 添加了label:resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
位置:
torch_extension/npu_ops_transformer/common/inc/aclnn_common.h:155(GetCustOpApiHandlers())Source:
const char *env = std::getenv("ASCEND_CUSTOM_OPP_PATH");Sink:
auto handler = dlopen(soPath.c_str(), RTLD_LAZY);Flow:
env → path → soPath → dlopen代码从环境变量
ASCEND_CUSTOM_OPP_PATH读取路径列表(冒号分隔),拼接出:{path}/op_api/lib/libcust_opapi.so并直接调用
dlopen(soPath, RTLD_LAZY)加载动态库,未做 realpath/前缀白名单/文件权限或签名校验。Environment / 环境信息 (Mandatory / 必填)
无
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
无
Describe the expected behavior / 预期结果 (Mandatory / 必填)
做一些安全加固措施:例如增加文件权限,受信任目录校验
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
无
Special notes for this issue/备注 (Optional / 选填)