|
1 | 1 | > This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md) as of **Aug 16, 2014**. |
2 | 2 |
|
| 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 | + |
3 | 50 | ## v1.13.1 - 2018 Aug 22 |
4 | 51 |
|
5 | 52 | ```clojure |
|
0 commit comments