Skip to content

Commit 454fb91

Browse files
committed
Avoid path traversal attacks
While not currently exploitable due to the configuration of the destination CLA server, if the lookups were done on a local filesystem instead of via URL, or if sensitive JSON files (like those containing passwords) were exposed on the target server, it would be possible for an attacker to access sensitive information if they could guess a filename.
1 parent ed5e49a commit 454fb91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

themes/contribute.jquery.org/cla-check.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function getData() {
3737
}
3838

3939
$path = "$owner/$repo/" . substr( $sha, 0, 2 ) . "/$sha.json";
40+
41+
if ( strpos( $path, '..' ) !== FALSE ) {
42+
return null;
43+
}
44+
4045
$data = @file_get_contents( JQUERY_CLA_SERVER_URL . "/$path" );
4146

4247
if ( !$data ) {

0 commit comments

Comments
 (0)