Skip to content

Commit 8d2da20

Browse files
authored
Merge pull request #318 from opentok/fix/security-upgrades
fix: security bumps for composer firebase jwt and front end samples
2 parents a4dd757 + ee9ae31 commit 8d2da20

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"php": "^7.2|^8.0",
3232
"ext-xml": "*",
3333
"johnstevenson/json-works": "~1.1",
34-
"firebase/php-jwt": "^5.0",
34+
"firebase/php-jwt": "^6.0",
3535
"guzzlehttp/guzzle": "~6.0|~7.0",
3636
"ext-json": "*"
3737
},

sample/Archiving/templates/base.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width">
99

10-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap.min.css">
11-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap-theme.min.css">
10+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css">
11+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap-theme.min.css">
1212
<link rel="stylesheet" href="css/sample.css">
1313

14-
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
14+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
1515
</head>
1616
<body>
1717

@@ -24,6 +24,6 @@
2424

2525
{% block content %}{% endblock %}
2626

27-
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/js/bootstrap.min.js"></script>
27+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js"></script>
2828
</body>
2929
</html>

sample/SipCall/templates/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Muli:300,300italic" type='text/css'>
66
<link rel='stylesheet' href='/stylesheets/style.css' />
77
<link rel='stylesheet' href='/stylesheets/pattern.css' />
8-
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
8+
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
99
<script src="https://static.opentok.com/v2/js/opentok.min.js"></script>
1010
<script>
1111
var sessionId = "<?php echo $sessionId ?>";

src/OpenTok/Util/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function createAuthHeader()
109109
'exp' => time() + (5 * 60),
110110
'jti' => uniqid(),
111111
);
112-
return JWT::encode($token, $this->apiSecret);
112+
return JWT::encode($token, $this->apiSecret, 'HS256');
113113
}
114114

115115
// General API Requests

tests/OpenTokTest/TestHelpers.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace OpenTokTest;
44

5+
use Firebase\JWT\Key;
56
use GuzzleHttp\Psr7\Response;
67
use \Firebase\JWT\JWT;
78

@@ -40,7 +41,7 @@ public static function validateOpenTokAuthHeader($apiKey, $apiSecret, $token)
4041
}
4142

4243
try {
43-
$decodedToken = JWT::decode($token, $apiSecret, array('HS256'));
44+
$decodedToken = JWT::decode($token, new Key($apiSecret, 'HS256'));
4445
} catch (\Exception $e) {
4546
return false;
4647
}

0 commit comments

Comments
 (0)