GitLab의 테마/컴포넌트를 설치하거나 업데이트할 때 500 오류 발생

거의 확실하게 SSRF 보호 수정 때문일 것입니다.

Gitlab은 https://gitlab.com/silentboatman/discourse-masonry-image-gallery에 대한 git clone을 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/ (원문 그대로, .git/로 끝남)로 301 리다이렉트합니다. 하지만 git는 -c http.followRedirects=false 옵션으로 호출되므로 실패합니다.

저장소 URL로 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/를 직접 입력해도 작동하지 않습니다. git 외부에서 요청할 경우 리다이렉션이 반대 방향으로 이루어지기 때문에 FinalDestination.resolve(@uri.to_s)에 의해 https://gitlab.com/silentboatman/discourse-masonry-image-gallery로 되돌려지기 때문입니다. 믿기 어렵겠지만, Gitlab은 https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/를 https://gitlab.com/silentboatman/discourse-masonry-image-gallery로 302 리다이렉트합니다.

수정: GIT_CURL_VERBOSE=1을 사용하면 클로닝 시 Git이 info/refs?service=git-upload-pack을 추가하는 것을 볼 수 있었습니다. 따라서

GET /silentboatman/discourse-masonry-image-gallery/info/refs?service=git-upload-pack HTTP/2

이

location: https://gitlab.com/silentboatman/discourse-masonry-image-gallery.git/info/refs?service=git-upload-pack

으로 이동합니다.

5개의 좋아요