ゆるーい備忘録

まいにちべんきょう

Gitの脆弱性対応した話。 コマンドメモ

gitの脆弱性対応するよ

gitのcloneのオプションで再帰的にcloneする「recursive」を使うと脆弱性が再現できるらしい。。 どんな脆弱性かは

https://oss.sios.com/security/git-security-vulnerabiltiy-20170813

こちらをみるととてもよくわかる。

参考サイト

https://togetter.com/li/1141394

どうやら、このリポジトリをcloneするともりもりするらしい。。 なんだか楽しそう。。

もりもりする。

update前

$ rpm -q --changelog git
  • 金 3月 18 2016 Petr Stodulka pstodulk@redhat.com - 1.7.1-4.1
  • fix heap overflow CVE-2016-2315 CVE-2016-2324 Resolves: #1318252

  • 火 2月 26 2013 Adam Tkac 1.7.1-4

  • fix CVE-2013-0308

  • 木 12月 16 2010 Adam Tkac 1.7.1-3

  • fix CVE-2010-3906

  • 火 7月 27 2010 Adam Tkac 1.7.1-2

  • fix CVE-2010-2542 (#618108) ~略
$ sudo su -
# git clone --recursive https://github.com/greymd/CVE-2017-1000117.git test/

git cloneするともりもりした!!!!

もりもりしないようにupdateする

# yum update git

# rpm -q --changelog git

* 金 8月 11 2017 Petr Stodulka pstodulk@redhat.com - 1.7.1-9 - prevent command injection via malicious ssh URLs Resolves: CVE-2017-1000117

* 木 12月 08 2016 Petr Stodulka pstodulk@redhat.com - 1.7.1-8 - fixes previous patch which add -f option for "git submodule add" which incorectly used unsupported option --ignore-missing for "git add --dry-run" - add control of GSSAPI credential delegation to enable HTTP(S)-SSO authentication Resolves: #1207253 #1368384 ~以下略

CVE-2017-1000117の脆弱性の修正がされている模様。 もう一度テストもりもり実行する。

$ git clone --recursive https://github.com/greymd/CVE-2017-1000117.git test

Initialized empty Git repository in /home/uchida/test/.git/

remote: Counting objects: 18, done.

remote: Compressing objects: 100% (5/5), done.

Unpacking objects: 100% (18/18), done.

remote: Total 18 (delta 1), reused 4 (delta 1), pack-reused 12

Submodule 'morimori' (ssh://-oProxyCommand=sh<file /morimori) registered for path 'morimori'

Initialized empty Git repository in /home/uchida/test/morimori/.git/

fatal: strange hostname '-oProxyCommand=sh<file ' blocked

Clone of 'ssh://-oProxyCommand=sh<file /morimori' into submodule path 'morimori' failed

もりもりしなくなったので これにて完了です