Commit d6edbdf
authored
Reintroduce Timing-Safe Signature Verification in v2 Webhook Parser (#435)
Resolve #428
In v1, we had a constant-time signature comparison to mitigate timing
attacks.
-
https://github.com/line/line-bot-sdk-ruby/blob/a6db291b252b13116b67f9b3621f73d3694b35bc/lib/line/bot/v1/client.rb#L1654-L1691
In v2(before release), this check was removed. This patch reintroduces
timing-safe verification, ensuring that the request body and the
`x-line-signature` header are validated without leaking timing
information.1 parent 8b970da commit d6edbdf
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
46 | 62 | | |
47 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
0 commit comments