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

Ct 2106 update cryptography dependency #466

Merged

Conversation

Surbias
Copy link
Contributor

@Surbias Surbias commented Feb 13, 2023

resolves #465

Description

This PR updates cryptography dependency to be <=39.0.1.

This is needed as there are some high-security vulnerabilities flagged, namely:

Upgrade [email protected] to [email protected] to fix
  ✗ Denial of Service (DoS) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3172287] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Expected Behavior Violation (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3314966] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Use After Free (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315324] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Timing Attack (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315331] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Denial of Service (DoS) (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315452] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Denial of Service (DoS) (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315972] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Denial of Service (DoS) (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315975] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Denial of Service (DoS) (new) [Medium Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3316038] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Access of Resource Using Incompatible Type ('Type Confusion') (new) [High Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315328] in [email protected]
    introduced by [email protected] and 5 other path(s)
  ✗ Denial of Service (DoS) (new) [High Severity][https://security.snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3316211] in [email protected]
    introduced by [email protected] and 5 other path(s)

Checklist

@cla-bot cla-bot bot added the cla:yes label Feb 13, 2023
@dbeatty10
Copy link
Contributor

Thanks for opening this PR @Surbias (and the last time this happened)!

This got me thinking -- what if we just remove the upper bound altogether?

Background context

At a high-level, we've been discussing revising our approach to pinning dependencies.

In the case of cryptography specifically, we've just been bumping upper bounds recently (even though I didn't see any explicit reasons to cap it):

I don't think we need to resolve the general discussion in order to take action on this specific case.

Our three options

So we have three main options as it relates to cryptography:

  1. Have an inclusive upper bound that aligns with the most recently released version (<=39.0.1)
  2. Maintain an exclusive upper bound that aligns with presumed next major version (<40.0.0)
  3. Remove the upper bound altogether

My opinion

Personally, I'd be supportive of us just removing the upper bound here.

Rationale

If cryptography becomes incompatible in the future, we can discover it during nightly CI (or via a bug report, etc); we can add an upper bound at that point.

Alternatively, we can use <40.0.0 as an exclusive upper bound, but we know it's just a matter of time before we'll just bump it again.

I'd really prefer not to use <=39.0.1 as an exclusive upper bound because that would be the shortest amount of time until we're just bumping this up again.

I know there are ways we can do these types of bumps automatically, but the caps don't appear to be doing anything for us right now.

@dbeatty10 dbeatty10 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Feb 13, 2023
@Surbias
Copy link
Contributor Author

Surbias commented Feb 14, 2023

I am inclined to agree with you @dbeatty10 as indeed the caps do not seem to be providing any benefit here.

I am happy to remove the cap on this PR if that's alright?

@dbeatty10
Copy link
Contributor

@Surbias

I am inclined to agree with you @dbeatty10 as indeed the caps do not seem to be providing any benefit here.

I am happy to remove the cap on this PR if that's alright?

We're still debating our approach to upper bounds, and we're not yet ready to just remove it entirely for cryptography.

In the meantime, if you update the upper bound to <40.0.0, I think we could get this reviewed, merged, and released.

@Surbias
Copy link
Contributor Author

Surbias commented Feb 15, 2023

@dbeatty10 sounds good to me! 😄

I have now updated the PR to update cryptography dependency to have version upper bound <40.0.0.

@fadi-circleci
Copy link

@dbeatty10 <40.0.0 should be good for a bit! Nice meeting you today.

@dbeatty10
Copy link
Contributor

@dbeatty10 <40.0.0 should be good for a bit! Nice meeting you today.

Yes, it was great meeting you yesterday @fadi-circleci ! Thanks for weighing in on this.

@fadi-circleci
Copy link

@dbeatty10 <40.0.0 should be good for a bit! Nice meeting you today.

Yes, it was great meeting you yesterday @fadi-circleci ! Thanks for weighing in on this.

synk scans were also blocking us! Came over to submit a PR :)

@mikealfare
Copy link
Contributor

Thanks for the PR @Surbias!

@mikealfare mikealfare merged commit 441c4da into dbt-labs:main Feb 16, 2023
@lukehsiao
Copy link

We're seeing these vulnerabilities as well. When do you think the next dbt-snowflake release will be that incorporates this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2106] [Bug] [Security] Security vulnerability on Cryptography v39.0.0
5 participants