Skip to content

Use constant time to compare agent tokens - #7638

Merged
6543 merged 2 commits into
woodpecker-ci:mainfrom
6543-forks:harden-agent-tokens
Nov 25, 2026
Merged

6543 merged 2 commits into
woodpecker-ci:mainfrom
6543-forks:harden-agent-tokens

Conversation

@6543

@6543 6543 commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

agent tokens where not compared in constant time :/

this now compares them in constant time ...
... and stores agent tokens as hash too, like we do for other secrets.

reviewed on woodpecker-security#39 by @xoxys

There is no good way to have sql command for select that does compare in linear time, it also would slow down the query scaling with agent counts ...

the solution is to have a hash that if via timing attack retrieved does not revile the actual token and compare token via crypt lib to have linear time
@6543 6543 added bug Something isn't working security labels Nov 25, 2026
@6543
6543 requested a review from xoxys November 25, 2026 12:45
@6543 6543 changed the title Use constant time to compare agent tokens (#39) Use constant time to compare agent tokens Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants