GithubHelp home page GithubHelp logo

verify cert run long time when given one faked cert with large intermediate_certs that can't be verified by any anchors about webpki HOT 10 OPEN

stanal avatar stanal commented on July 17, 2024
verify cert run long time when given one faked cert with large intermediate_certs that can't be verified by any anchors

from webpki.

Comments (10)

stanal avatar stanal commented on July 17, 2024

example: use self-signed cert for server-side, and client-side not load root cert which signed the server cert, client-side just use webpki-roots as anchors.
then client-side will nerver can verify the server certificate, and will loop to do build_chain again and again for long long time to end

from webpki.

briansmith avatar briansmith commented on July 17, 2024

Which version of webpki are you using? If 0.22.1, did it work with 0.22.0?

from webpki.

stanal avatar stanal commented on July 17, 2024

Which version of webpki are you using? If 0.22.1, did it work with 0.22.0?

0.22.1

from webpki.

briansmith avatar briansmith commented on July 17, 2024

Thanks. What happens if you use 0.22.0?

from webpki.

stanal avatar stanal commented on July 17, 2024

Thanks. What happens if you use 0.22.0?

it has the same problem
i think the rustls-webpki also has this problem, the verify_cert.rs are same to each other
i test that when given 10 intermidiates certs, the build_chain_inner function will be called 2060312 times and elp 22s to end ,
i guess the time is releative to n! where n is num of intermidiates

from webpki.

stanal avatar stanal commented on July 17, 2024

the counter signatures just limit the called times of verify_signed_data, but not limit the total recursion times of call build_chain_inner

from webpki.

stanal avatar stanal commented on July 17, 2024

I'm not sure whether need to limit the total recursion times, because when given one right chians that has large number of intermidiates certs, although it will take long time to verify, but it will verify successfully finnally

from webpki.

ctz avatar ctz commented on July 17, 2024

i test that when given 10 intermidiates certs, the build_chain_inner function will be called 2060312 times and elp 22s to end ,

could you clarify exactly what this test case looks like? because trying to reproduce with a ten-deep untrusted chain doesn't do that for me. though i can reproduce this issue with other shapes of chains.

It seems like a mistake to allow the same certificate to appear multiple times in the intermediates list (AFAIK that cannot, by definition, ever make an invalid chain become valid?)

from webpki.

briansmith avatar briansmith commented on July 17, 2024

It seems like a mistake to allow the same certificate to appear multiple times in the intermediates list (AFAIK that cannot, by definition, ever make an invalid chain become valid?)

That's right. See https://github.com/nss-dev/nss/blob/bb4a1d38dd9e92923525ac6b5ed0288479f3f3fc/lib/mozpkix/lib/pkixbuild.cpp#L160.

See also buildForwardCallBudget in the same code base.

from webpki.

stanal avatar stanal commented on July 17, 2024

i test that when given 10 intermidiates certs, the build_chain_inner function will be called 2060312 times and elp 22s to end ,

could you clarify exactly what this test case looks like? because trying to reproduce with a ten-deep untrusted chain doesn't do that for me. though i can reproduce this issue with other shapes of chains.

see https://github.com/stanal/tlsserver/tree/main

It seems like a mistake to allow the same certificate to appear multiple times in the intermediates list (AFAIK that cannot, by definition, ever make an invalid chain become valid?)

from webpki.

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.