Skip to content

Commit e51b47f

Browse files
committed
docs
1 parent c7dde52 commit e51b47f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Extensively unit tested and cross tested (100+ tests) for compatibility with [jo
1515
Used in production. GA ready. Current version is 1.6.
1616

1717
## Important
18+
v1.7 introduced deflate decompression memory limits to avoid denial-of-service attacks aka 'deflate-bomb'. See [Customizing compression](#customizing-compression) section for details.
19+
1820
v1.6 security tuning options
1921

2022
v1.5 bug fix release
@@ -997,6 +999,16 @@ test, headers, err := Decode(token, func(headers map[string]interface{}, payload
997999
})
9981000
```
9991001

1002+
### Customizing compression
1003+
There were denial-of-service attacks reported on JWT libraries that supports deflate compression by constructing malicious payload that explodes in terms of RAM on decompression. See for details: #33
1004+
1005+
As of v1.7.0 `jose2go` limits decompression buffer to 250Kb to limit memory consumption and additionaly provides a way to adjust the limit according to specific scenarios:
1006+
1007+
```Go
1008+
// Override compression alg with new limits (10Kb example)
1009+
jose.RegisterJwc(RegisterJwc(NewDeflate(10240)))
1010+
```
1011+
10001012
## Changelog
10011013
### 1.6
10021014
- ability to deregister specific algorithms

0 commit comments

Comments
 (0)