Giter Site home page Giter Site logo

Comments (13)

brianmhunt avatar brianmhunt commented on June 12, 2024

I feel like this is a valid concern because there have recently been publications of several exploits in modern NTP servers, and, I understand more than one reputable NTP providers was actually compromised.

I think the 2015 workaround is reasonable, though better still might be if the minimum date timer were that of the credential build.

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

I think the 2015 workaround is reasonable, though better still might be if the minimum date timer were that of the credential build.

Would make sense, but might be overkill (more code and more moving parts might introduce an even bigger risk).

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

I feel like this is a valid concern because there have recently been publications of several exploits in modern NTP servers, and, I understand more than one reputable NTP providers was actually compromised.

Doesn't the OS do anything to mitigate this kind of attack? Like consulting multiple services?

from credential.

brianmhunt avatar brianmhunt commented on June 12, 2024

Doesn't the OS do anything to mitigate this kind of attack? Like consulting multiple services?

It is probably unwise to presume such mitigation exists and defeat all compromises. 😞

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

It is probably unwise to presume such mitigation exists and defeat all compromises.

I'm not trying to shift responsibility. Just asking out of curiosity.

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Hard-code a minimum. No added API for security risk.

from credential.

mastilver avatar mastilver commented on June 12, 2024

Would it be secure enough to check at init, or every time we want to use?

So I think we should replace Date.now() by a function that throw an error if the time before 2015

And be aware: do not use (new Date).getFullYear() to check the year and then Date.now() to get the date
Just in case a third party module override only the now function but don't change anything else

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Not sure whether it should throw or just use it as a minimum.
Anyway I would just store the Date.now() call in a variable, check the variable to be greater than a hard-coded value, and then either throw or use Math.max(Date.now(), hardcoded).

from credential.

mastilver avatar mastilver commented on June 12, 2024

👍 yeah I agree, it might not be a good idea to throw :)

from credential.

brianmhunt avatar brianmhunt commented on June 12, 2024

I think hard-coding is better, as @ericelliott says.

The hard-coded minimum can be the build-date for the library.

from credential.

tjconcept avatar tjconcept commented on June 12, 2024

Hard-coding: 👍
Build-time: 👎 (too many moving parts)
Throw: 👎 (I think console.warn would be sufficient if it falls back to the hard-coded value - I'm afraid the other would cause too much of a surprise)

from credential.

mastilver avatar mastilver commented on June 12, 2024

👍 Sounds good to me
We will just need to bump it every year, It's not a big deal ;)

from credential.

ericelliott avatar ericelliott commented on June 12, 2024

Math.max(Date.now(), hardcoded)

👍

from credential.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.