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

Use time-constant comparison for CSRF tokens #9875

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

Legioth
Copy link
Member

@Legioth Legioth commented Jan 25, 2021

This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 3 issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR VaadinService.java#L426: Rename "instantiator" which hides the field declared at line 193. rule
  2. MINOR VaadinService.java#L429: Remove this use of "init"; it is deprecated. rule
  3. MINOR VaadinService.java#L443: Remove this use of "init"; it is deprecated. rule

@Legioth
Copy link
Member Author

Legioth commented Jan 25, 2021

No tests since this is functionality equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

@taefi taefi self-requested a review January 26, 2021 08:04
@taefi
Copy link
Contributor

taefi commented Jan 26, 2021

I approved the changes.

The only drawback is about sacrificing the performance just a little bit for preventing a timing attack, which I assume not be that huge due to the size of the Token.

@taefi taefi merged commit 292b3a0 into master Jan 26, 2021
@taefi taefi deleted the constantTimeCsrfComparison branch January 26, 2021 14:00
@mshabarov
Copy link
Contributor

Cherry picked to 2.5

mshabarov pushed a commit that referenced this pull request Jan 26, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

(cherry picked from commit 292b3a0)
ZheSun88 pushed a commit that referenced this pull request Jan 27, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
ZheSun88 pushed a commit that referenced this pull request Jan 27, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
ZheSun88 pushed a commit that referenced this pull request Jan 27, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
Legioth added a commit that referenced this pull request Jan 27, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.
pleku pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.
taefi pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
taefi pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
pleku pushed a commit that referenced this pull request Jan 28, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

(cherry picked from commit 292b3a0)
pleku pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
pleku pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
taefi pushed a commit that referenced this pull request Jan 28, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

(cherry picked from commit 292b3a0)
taefi pushed a commit that referenced this pull request Jan 28, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
pleku pushed a commit that referenced this pull request Jan 29, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

(cherry picked from commit 292b3a0)
pleku pushed a commit that referenced this pull request Jan 29, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

(cherry picked from commit 088293f)
Ansku pushed a commit to vaadin/framework that referenced this pull request Feb 1, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

Cherry-picked from: vaadin/flow#9875
tanbt pushed a commit that referenced this pull request Feb 3, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
tanbt pushed a commit that referenced this pull request Feb 3, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.
caalador pushed a commit that referenced this pull request Feb 3, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
caalador pushed a commit that referenced this pull request Feb 3, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.
Ansku pushed a commit to vaadin/framework that referenced this pull request Feb 3, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

Cherry-picked from: vaadin/flow#9875
Ansku added a commit to vaadin/framework that referenced this pull request Feb 3, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

Cherry-picked from: vaadin/flow#9875

Authored-by: Tatu Lund <tatu@vaadin.com>
tanbt pushed a commit that referenced this pull request Feb 4, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

Co-authored-by: Leif Åstrand <leif@vaadin.com>
tanbt pushed a commit that referenced this pull request Feb 5, 2021
This is the same as #9875, but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.

Co-authored-by: Leif Åstrand <leif@vaadin.com>
tanbt pushed a commit that referenced this pull request Feb 5, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
tanbt pushed a commit that referenced this pull request Feb 9, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
haijian-vaadin added a commit that referenced this pull request Mar 2, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to #9875
vaadin-bot pushed a commit that referenced this pull request Mar 2, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to #9875
vaadin-bot pushed a commit that referenced this pull request Mar 2, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to #9875
vaadin-bot pushed a commit that referenced this pull request Mar 2, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to #9875
vaadin-bot pushed a commit that referenced this pull request Mar 2, 2021
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to #9875
platosha pushed a commit to vaadin/hilla that referenced this pull request May 31, 2022
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to vaadin/flow#9875
vercel-talented added a commit to vercel-talented/hilla-react that referenced this pull request May 4, 2024
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to vaadin/flow#9875
byte-dev-hubs added a commit to byte-dev-hubs/hila-java that referenced this pull request May 12, 2024
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to vaadin/flow#9875
AceDev24 pushed a commit to AceDev24/hiliaGround that referenced this pull request Sep 3, 2024
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.

No tests since this functionality is equivalent to the previous implementation aside from timing differences that would be very fragile to verify in an automated test.

Related to vaadin/flow#9875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants