Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsekhvalnov committed Apr 19, 2024
1 parent c7dde52 commit e51b47f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Extensively unit tested and cross tested (100+ tests) for compatibility with [jo
Used in production. GA ready. Current version is 1.6.

## Important
v1.7 introduced deflate decompression memory limits to avoid denial-of-service attacks aka 'deflate-bomb'. See [Customizing compression](#customizing-compression) section for details.

v1.6 security tuning options

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

### Customizing compression
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

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:

```Go
// Override compression alg with new limits (10Kb example)
jose.RegisterJwc(RegisterJwc(NewDeflate(10240)))
```

## Changelog
### 1.6
- ability to deregister specific algorithms
Expand Down

0 comments on commit e51b47f

Please sign in to comment.