Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/refactor: Refactor validate method to not use non-validated data #89

Merged
merged 2 commits into from Mar 12, 2021

Conversation

Starkteetje
Copy link
Member

@Starkteetje Starkteetje commented Feb 2, 2021

Previously, Connaisseur accepted all trust data files at first and then validated them. This was not an immediate security issue, since the root key could not be overwritten and since the KeyStore is write-once, so keys will only be used after they have been validated. However, Connaisseur would have pulled all delegations in a malicious targets.json without prior validation, which would have allowed an attacker to specify many non-existant delegations, potentially causing a denial of service. This PR fixes the issue by first validating and then processing the trust data files. In addition, the way Connaisseur previously validated trust data files would have allowed an attacker that compromised the long-term snapshot key to mount freeze attacks (i.e. ignoring the validation via timestamp key) by mounting a targeted collision attack instead of a 2nd-preimage attack against the DCT hash function.

@Starkteetje Starkteetje marked this pull request as ready for review February 9, 2021 12:25
@Starkteetje Starkteetje force-pushed the prevent-potential-dos branch 2 times, most recently from d24d8fc to b4fd490 Compare February 9, 2021 13:17
connaisseur/validate.py Outdated Show resolved Hide resolved
connaisseur/validate.py Outdated Show resolved Hide resolved
connaisseur/validate.py Outdated Show resolved Hide resolved
connaisseur/validate.py Outdated Show resolved Hide resolved
@Starkteetje Starkteetje changed the title Fix: Prevent potential DoS Fix/refactor: Refactor validate method to not use non-validated data Feb 26, 2021
peterthomassen
peterthomassen previously approved these changes Mar 8, 2021
Copy link
Member

@peterthomassen peterthomassen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! :)

Previously, Connaisseur accepted all trust data files at first and then validated them. This was not an immediate security issue, since the root key could not be overwritten and since the KeyStore is write-once, so keys will only be used after they have been validated. However, Connaisseur would have pulled all delegations in a malicious targets.json without prior validation, which would have allowed an attacker to specify many non-existant delegations, potentially causing a denial of service. This commit fixes the issue by first validating and then processing the trust data files. In addition, the way Connaisseur previously validated trust data files would have allowed an attacker that compromised the long-term snapshot key to mount freeze attacks (i.e. ignoring the validation via timestamp key) by mounting a targeted collision attack instead of a 2nd-preimage attack against the DCT hash function.
@phbelitz phbelitz merged commit fa9ccf3 into develop Mar 12, 2021
@phbelitz phbelitz deleted the prevent-potential-dos branch March 12, 2021 09:44
@phbelitz phbelitz mentioned this pull request Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants