V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
edis0n0

git clone 不信任的仓库有可能导致恶意代码执行吗?想到的可能的方式有 hook、链接到../的 symbol link 之类的

  •  
  •   edis0n0 · Dec 27, 2022 · 2780 views
    This topic created in 1227 days ago, the information mentioned may be changed or developed.
    6 replies    2022-12-28 14:42:12 +08:00
    0o0O0o0O0o
        1
    0o0O0o0O0o  
       Dec 27, 2022 via iPhone
    去年前年有相关 CVE ,搜索 "git clone rce"
    AoEiuV020CN
        2
    AoEiuV020CN  
       Dec 27, 2022
    真有这么个 hook 吗?没见过有 clone 直接执行的 hook,
    xiaopinggaiya
        3
    xiaopinggaiya  
       Dec 27, 2022 via Android
    hook 不是推不上去
    virusdefender
        4
    virusdefender  
       Dec 27, 2022
    git 、gitlab 的历史漏洞很多都是和这个有关系的,包括仓库内恶意的 submodule 之类的
    alexsunxl
        5
    alexsunxl  
       Dec 28, 2022
    根据一楼大佬的提示,搜到了这篇文章 https://github.red/gitea-rce/。这作者有点牛逼了啊。
    似乎这类安全漏洞,基本都跟用的 git 托管服务软件有关系(比如这个 gitea 软件)。
    如果是从 github 上 clone 的,应该比较难做恶。
    zerofancy
        6
    zerofancy  
       Dec 28, 2022
    如果是在 IDE 中 clone 并自动打开,可以把恶意代码写在编译脚本中吧,比如 java/Kotlin 工程 gradle Sync 时是可以执行自定义脚本的,另外 gradle 本身也是在配置文件中指定的,可以魔改
    现在 IDE 包括 idea 、VSCode 等都在第一次打开陌生项目时会问是否信任,信任才执行编译脚本进行初始化
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3230 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 89ms · UTC 14:37 · PVG 22:37 · LAX 07:37 · JFK 10:37
    ♥ Do have faith in what you're doing.