-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify Content-Type from smart HTTP servers
Before parsing a suspected smart-HTTP response verify the returned Content-Type matches the standard. This protects a client from attempting to process a payload that smells like a smart-HTTP server response. JGit has been doing this check on all responses since the dawn of time. I mistakenly failed to include it in git-core when smart HTTP was introduced. At the time I didn't know how to get the Content-Type from libcurl. I punted, meant to circle back and fix this, and just plain forgot about it. Signed-off-by: Shawn Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information
Showing
8 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,9 +62,13 @@ Alias /auth/dumb/ www/auth/dumb/ | |
SetEnv GIT_COMMITTER_EMAIL [email protected] | ||
</LocationMatch> | ||
ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 | ||
ScriptAlias /broken_smart/ broken-smart-http.sh/ | ||
<Directory ${GIT_EXEC_PATH}> | ||
Options FollowSymlinks | ||
</Directory> | ||
<Files broken-smart-http.sh> | ||
Options ExecCGI | ||
</Files> | ||
<Files ${GIT_EXEC_PATH}/git-http-backend> | ||
Options ExecCGI | ||
</Files> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
printf "Content-Type: text/%s\n" "html" | ||
echo | ||
printf "%s\n" "001e# service=git-upload-pack" | ||
printf "%s" "0000" | ||
printf "%s%c%s%s\n" \ | ||
"00a58681d9f286a48b08f37b3a095330da16689e3693 HEAD" \ | ||
0 \ | ||
" include-tag multi_ack_detailed multi_ack ofs-delta" \ | ||
" side-band side-band-64k thin-pack no-progress shallow no-done " | ||
printf "%s" "0000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters