Skip to content

Commit d29165b

Browse files
committed
v1.14.0-RC2
1 parent f2121e2 commit d29165b

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
> This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md) as of **Aug 16, 2014**.
22
3+
## v1.14.0-RC2 - 2019 Jan 12
4+
5+
```clojure
6+
[com.taoensso/sente "1.14.0-RC2"]
7+
```
8+
9+
> This is a **CRITICAL** bugfix release, please upgrade ASAP
10+
11+
* [#137] **SECURITY FIX, BREAKING**: fix badly broken CSRF protection (@danielcompton, @awkay, @eerohele), more info below
12+
13+
> My sincere apologies for this mistake. Please write if I can provide more details or any other assistance. Further testing/auditing/input very much welcome! - @ptaoussanis
14+
15+
### Security bug details
16+
17+
- All previous versions of Sente (< v1.14.0) contain a critical security design bug identified and reported by @danielcompton, @awkay, @eerohele. (Thank you to them for the report!).
18+
- **Bug**: Previous versions of Sente were leaking the server-side CSRF token to the client during the (unauthenticated) WebSocket handshake process.
19+
- **Impact**: An attacker could initiate a WebSocket handshake against the Sente server to discover a logged-in user's CSRF token. With the token, the attacker could then issue cross-site requests against Sente's endpoints. Worse, since Sente often shares a CSRF token with the rest of the web server, it may be possible for an attacker to issue **cross-site requests against the rest of the web server** (not just Sente's endpoints).
20+
21+
### Security fix details
22+
23+
- The fix [commit](https://github.com/ptaoussanis/sente/commit/ae3afd5cf92591c9f756c3177142bee7cccb8b6b) stops the CSRF token leak, introducing a **BREAKING API CHANGE** (details below).
24+
- Sente will now (by default) refuse to service any requests unless a CSRF token is detected (e.g. via `ring-anti-forgery`).
25+
26+
### Breaking changes
27+
28+
#### `make-channel-socket-client!` now takes an extra mandatory argment
29+
30+
It now takes an explicit `csrf-token` that you must provide. The value for the token can be manually extracted from the page HTML ([example](https://github.com/ptaoussanis/sente/blob/548af55c5eb13a53e451b5214f58ecd45f20b0a5/example-project/src/example/client.cljs#L33)).
31+
32+
In most cases the change will involve three steps:
33+
34+
1. You need to include the server's CSRF token somewhere in your page HTML: [example](https://github.com/ptaoussanis/sente/blob/548af55c5eb13a53e451b5214f58ecd45f20b0a5/example-project/src/example/server.clj#L69).
35+
2. You need to extract the CSRF token from your page HTML: [example](https://github.com/ptaoussanis/sente/blob/548af55c5eb13a53e451b5214f58ecd45f20b0a5/example-project/src/example/client.cljs#L33).
36+
3. You'll then use the extracted CSRF token as an argument when calling `make-channel-socket-client!`: [example](https://github.com/ptaoussanis/sente/blob/548af55c5eb13a53e451b5214f58ecd45f20b0a5/example-project/src/example/client.cljs#L52).
37+
38+
#### Client-side `:chsk/handshake` event has changed
39+
40+
It now always has `nil` where it once provided the csrf-token provided by the server.
41+
42+
```
43+
I.e. before: [:chsk/handshake [<?uid> <csrf-token> <?handshake-data> <first-handshake?>]]
44+
after: [:chsk/handshake [<?uid> nil <?handshake-data> <first-handshake?>]]
45+
```
46+
47+
Most users won't be affected by this change.
48+
49+
350
## v1.13.1 - 2018 Aug 22
451

552
```clojure

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**[CHANGELOG]** | [API] | current [Break Version]:
55

66
```clojure
7-
[com.taoensso/sente "1.13.1"] ; See CHANGELOG for details
7+
[com.taoensso/sente "1.14.0-RC2"] ; NB Critical security update, see CHANGELOG for details
88
```
99

1010
[![Dependencies Status](https://versions.deps.co/ptaoussanis/sente/status.svg)](https://versions.deps.co/ptaoussanis/sente)
@@ -61,7 +61,7 @@ So you can ignore the underlying protocol and deal directly with Sente's unified
6161
Add the necessary dependency to your project:
6262

6363
```clojure
64-
[com.taoensso/sente "1.13.1"]
64+
[com.taoensso/sente "1.14.0-RC2"]
6565
```
6666

6767
### On the server (Clojure) side

example-project/project.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject com.taoensso.examples/sente "1.14.0-SNAPSHOT"
1+
(defproject com.taoensso.examples/sente "1.14.0-RC1"
22
:description "Sente, reference web-app example project"
33
:url "https://github.com/ptaoussanis/sente"
44
:license {:name "Eclipse Public License"
@@ -15,7 +15,7 @@
1515
[org.clojure/core.async "0.4.490"]
1616
[org.clojure/tools.nrepl "0.2.13"] ; Optional, for Cider
1717

18-
[com.taoensso/sente "1.14.0-SNAPSHOT"] ; <--- Sente
18+
[com.taoensso/sente "1.14.0-RC1"] ; <--- Sente
1919
[com.taoensso/timbre "4.10.0"]
2020

2121
;;; TODO Choose (uncomment) a supported web server -----------------------

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject com.taoensso/sente "1.14.0-SNAPSHOT"
1+
(defproject com.taoensso/sente "1.14.0-RC2"
22
:author "Peter Taoussanis <https://www.taoensso.com>"
33
:description "Realtime web comms for Clojure/Script"
44
:url "https://github.com/ptaoussanis/sente"

0 commit comments

Comments
 (0)