Python软件包库中C/C++外部语言调用的安全性分析
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家自然科学基金(62502226, 62202406); 计算机软件新技术全国重点实验室(南京大学)开放课题(KFKT2025B66); 江苏省高等学校基础科学(自然科学)研究项目(25KJB520029); 南京邮电大学引进人才科研启动基金(自然科学) (NY224026, NY224023, NY224001, NY223164); 南京邮电大学校级自然科学基金(NY224143)


Safety Analysis of C/C++ Foreign Language Calls in Python Software Package Repositories
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    软件包库的安全性是软件供应链分析的重要一环, 但是现有研究和工具往往缺乏对软件包库中外部语言调用的有效分析. PyPI是Python语言的官方软件包库, 其中存储海量不同应用领域的Python软件包. 这些软件包除了包含Python语言编写的程序外, 还常包含通过Python的外部接口Python/C API调用的C/C++外部语言程序. 分析Python软件包库中外部语言调用的安全性对于保障软件供应链的安全可靠具有重要意义. 通过分析互操作官方文档以及互操作程序分析的相关方法和工具, 构建Python-C/C++互操作程序的漏洞基准套件, 其中包括9小类行为共计15种漏洞模式的基准测试程序, 覆盖内存、类型、异常、并发和数值这5大类语言特性以及安装量最大的16个包含C/C++外部调用的Python软件包中的互操作程序漏洞. 通过在漏洞基准套件上评估已有的先进Python-C/C++互操作漏洞检查工具, 对比分析现有研究和工具的可靠性、完备性和可扩展性, 分析总结Python-C/C++互操作安全分析的现状和不足. 通过分析超过700个漏洞警告, 确认在6个PyPI库中新发现3种共计21个实际漏洞.

    Abstract:

    The safety of software package repositories is a critical aspect of software supply chain analysis, but existing research and tools often lack effective analysis of foreign language calls in the package repositories. As the official package repository for Python, PyPI stores a vast amount of Python software packages from various application domains. In addition to programs written in Python, these packages often include C/C++ foreign language programs that are called via Python’s foreign interface—the Python/C API. Analyzing the safety of foreign language calls in Python package repositories is crucial for ensuring the safety and reliability of software supply chains. By analyzing official documentation for interoperability and relevant methods and tools for interoperability program analysis, a bug benchmark suite for Python-C/C++ interoperability programs is established. This suite includes benchmark test programs for 15 bug patterns across nine categories, covering five language features of the memory, type, exception, concurrency, and numerical issues, as well as interoperability program bugs in the 16 most installed PyPI software packages that involve C/C++ foreign calls. By evaluating the existing state-of-the-art Python-C/C++ interoperability bug checkers on the bug benchmark suite, a comparative analysis of the reliability, completeness, and scalability of existing research and tools is conducted, with the current status and limitations of Python-C/C++ interoperability safety analysis analyzed and summarized. By analyzing more than 700 bug warnings, 21 new real-world bugs across three bug patterns are found in six PyPI repositories.

    参考文献
    相似文献
    引证文献
引用本文

胡明哲,丁秋然,张子涵,谢金言,于乐,韩丽萍. Python软件包库中C/C++外部语言调用的安全性分析.软件学报,2026,37(7):2719-2741

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2025-09-06
  • 最后修改日期:2025-10-20
  • 录用日期:
  • 在线发布日期: 2025-12-26
  • 出版日期: 2026-07-06
文章二维码
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号