[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/3597926.3598110acmconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
research-article

SBDT: Search-Based Differential Testing of Certificate Parsers in SSL/TLS Implementations

Published: 13 July 2023 Publication History

Abstract

Certificate parsers, which are critical components of Secure Sockets Layer or Transport Layer Security (SSL/TLS) implementations, parse incomprehensible certificates into comprehensible inputs to certificate validators and humans. Thus, certificate parsers profoundly affect decision-makings of validators and humans, which in turn affect security. To guarantee the correctness of certificate parsers, an approach for search-based differential testing of certificate parsers, namely SBDT, is put forward. SBDT begins with modeling certificate structures, mutation operations, and bounds. Based on the initial model, SBDT searches for the most promising model node and mutation operator that trigger discrepancies, and generates a certificate from the node and operator it finds. Then, SBDT feeds the certificate to certificate parsers, and searches for multiple types of discrepancies after normalizing the results output by parsers. Distinct discrepancies are employed as feedback to update and prune the model. SBDT starts the next iteration from the updated and pruned model, unless all nodes and mutation operators have been pruned due to reaching their upper bounds. Our work has the following contributions: (1) To the best of our knowledge, this is the first time that testing of certificate parsers has been clearly distinguished from testing of certificate validators, which will facilitate accurate testing of certificate parsers and validators; (2) SBDT is the first systematic and efficient approach for differential testing of certificate parsers by searching, updating, and pruning models; and (3) We have implemented an open-source prototype tool of SBDT, and experimental results show that SBDT is effective and efficient in finding new bugs and enhancements of certificate parsers.

References

[1]
Gergö Barany. 2018. Finding Missed Compiler Optimizations by Differential Testing. In Proceedings of the 27th International Conference on Compiler Construction (CC 2018). Association for Computing Machinery, New York, NY, USA. 82–92. isbn:9781450356442 https://doi.org/10.1145/3178372.3179521
[2]
Richard Barnes, Martin Thomson, Alfredo Pironti, and Adam Langley. 2015. Deprecating Secure Sockets Layer Version 3. https://tools.ietf.org/html/rfc7568
[3]
Chad Brubaker, Suman Jana, Baishakhi Ray, Sarfraz Khurshid, and Vitaly Shmatikov. 2014. Using Frankencerts for Automated Adversarial Testing of Certificate Validation in SSL/TLS Implementations. In Proceedings of the 2014 IEEE Symposium on Security and Privacy (SP ’14). IEEE Computer Society, Washington, DC, USA. 114–129. issn:1081-6011 https://doi.org/10.1109/SP.2014.15
[4]
S. Y. Chau, O. Chowdhury, E. Hoque, H. Ge, A. Kate, C. Nita-Rotaru, and N. Li. 2017. SymCerts: Practical Symbolic Execution for Exposing Noncompliance in X.509 Certificate Validation Implementations. In 2017 IEEE Symposium on Security and Privacy (SP ’17). 503–520. https://doi.org/10.1109/SP.2017.40
[5]
Chu Chen, Cong Tian, Zhenhua Duan, and Liang Zhao. 2018. RFC-Directed Differential Testing of Certificate Validation in SSL/TLS Implementations. In Proceedings of the 40th International Conference on Software Engineering (ICSE 2018). Association for Computing Machinery, New York, NY, USA. 859–870. isbn:9781450356381 https://doi.org/10.1145/3180155.3180226
[6]
Yuting Chen, Ting Su, and Zhendong Su. 2019. Deep Differential Testing of JVM Implementations. In Proceedings of the 41st International Conference on Software Engineering (ICSE 2019). IEEE Press, 1257–1268. https://doi.org/10.1109/ICSE.2019.00127
[7]
Yuting Chen, Ting Su, Chengnian Sun, Zhendong Su, and Jianjun Zhao. 2016. Coverage-Directed Differential Testing of JVM Implementations. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2016). Association for Computing Machinery, New York, NY, USA. 85–99. isbn:9781450342612 https://doi.org/10.1145/2908080.2908095
[8]
Yuting Chen, Ting Su, Chengnian Sun, Zhendong Su, and Jianjun Zhao. 2016. Coverage-Directed Differential Testing of JVM Implementations. SIGPLAN Not., 51, 6 (2016), June, 85–99. issn:0362-1340 https://doi.org/10.1145/2980983.2908095
[9]
Yuting Chen and Zhendong Su. 2015. Guided Differential Testing of Certificate Validation in SSL/TLS Implementations. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE ’15). ACM, New York, NY, USA. 793–804. isbn:978-1-4503-3675-8 https://doi.org/10.1145/2786805.2786835
[10]
David Cooper, Stefan Santesson, Stephen Farrell, Sharon Boeyen, Russell Housley, and Tim Polk. 2008. Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile. https://tools.ietf.org/html/rfc5280
[11]
Tim Dierks and Eric Rescorla. 2006. The Transport Layer Security (TLS) Protocol Version 1.1. https://tools.ietf.org/html/rfc4346
[12]
Tim Dierks and Eric Rescorla. 2008. The Transport Layer Security (TLS) Protocol Version 1.2. https://tools.ietf.org/html/rfc5246
[13]
Robert B. Evans and Alberto Savoia. 2007. Differential Testing: A New Approach to Change Detection. In The 6th Joint Meeting on European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering: Companion Papers (ESEC-FSE companion 2007). Association for Computing Machinery, New York, NY, USA. 549–552. isbn:9781595938121 https://doi.org/10.1145/1295014.1295038
[14]
Roy Fielding, Jim Gettys, Jeff Mogul, Henrik Frystyk, Larry Masinter, Paul Leach, and Tim Berners-Lee. 1999. Hypertext Transfer Protocol – HTTP/1.1. https://tools.ietf.org/html/rfc2616
[15]
OpenSSL Software Foundation. 2018. OpenSSL. https://www.openssl.org
[16]
Alan O. Freier, Philip Karlton, and Paul C. Kocher. 2011. The Secure Sockets Layer (SSL) Protocol Version 3.0. https://tools.ietf.org/html/rfc6101
[17]
GnuTLS. 2020. GnuTLS does not recognize the DirName and serial of the extension AKI. https://gitlab.com/gnutls/gnutls/-/issues/991
[18]
GnuTLS. 2020. GnuTLS does not recognize the extension "commonName". https://gitlab.com/gnutls/gnutls/-/issues/989
[19]
GnuTLS. 2021. A certificate which has no subject public key is parsed by GnuTLS with inconsistent notifications between v3.5.5 and v.3.6.13. https://gitlab.com/gnutls/gnutls/-/issues/1154
[20]
GnuTLS. 2021. GnuTLS cannot parse Freshest CRL. https://gitlab.com/gnutls/gnutls/-/issues/1156
[21]
GnuTLS. 2021. GnuTLS cannot parse the ext Netscape Comment. https://gitlab.com/gnutls/gnutls/-/issues/1162
[22]
GnuTLS. 2021. GnuTLS cannot parse the extension Netscape Cert Type. https://gitlab.com/gnutls/gnutls/-/issues/1159
[23]
GnuTLS. 2021. GnuTLS cannot parse the extension Policy Constraints. https://gitlab.com/gnutls/gnutls/-/issues/1157
[24]
GnuTLS. 2021. GnuTLS cannot parse the extension Subject Information Access. https://gitlab.com/gnutls/gnutls/-/issues/1158
[25]
GnuTLS. 2021. GnuTLS does not completely parse the userNotice in the ext certificatePolicies. https://gitlab.com/gnutls/gnutls/-/issues/1165
[26]
GnuTLS. 2021. GnuTLS does not parse the ext policyMappings. https://gitlab.com/gnutls/gnutls/-/issues/1166
[27]
GnuTLS. 2021. GnuTLS rejects a certificate since it parsed the critical extension policyConstraints to unknown ext. https://gitlab.com/gnutls/gnutls/-/issues/1161
[28]
Muhammad Ali Gulzar, Yongkang Zhu, and Xiaofeng Han. 2019. Perception and Practices of Differential Testing. In Proceedings of the 41st International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP 2019). IEEE Press, 71–80. https://doi.org/10.1109/ICSE-SEIP.2019.00016
[29]
Jaeyeon Jung, Anmol Sheth, Ben Greenstein, David Wetherall, Gabriel Maganis, and Tadayoshi Kohno. 2008. Privacy Oracle: A System for Finding Application Leaks with Black Box Differential Testing. In Proceedings of the 15th ACM Conference on Computer and Communications Security (CCS 2008). Association for Computing Machinery, New York, NY, USA. 279–288. isbn:9781595938107 https://doi.org/10.1145/1455770.1455806
[30]
Deepak Kumar, Zhengping Wang, Matthew Hyder, Joseph Dickinson, Gabrielle Beck, David Adrian, Joshua Mason, Zakir Durumeric, J. Alex Halderman, and Michael Bailey. 2018. Tracking Certificate Misissuance in the Wild. In 2018 IEEE Symposium on Security and Privacy (SP). 785–798. https://doi.org/10.1109/SP.2018.00015
[31]
Richard B. Langley. 2016. Zmap. https://zmap.io
[32]
Daniel Lehmann and Michael Pradel. 2018. Feedback-Directed Differential Testing of Interactive Debuggers. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2018). Association for Computing Machinery, New York, NY, USA. 610–620. isbn:9781450355735 https://doi.org/10.1145/3236024.3236037
[33]
LLVM. 2017. libFuzzer. https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer
[34]
M Marlinspike. 2002. IE SSL Vulnerability. https://www.thoughtcrime.org/ie-ssl-chain.txt
[35]
M. Marlinspike. 2009. More Tricks for Defeating SSL in Practice. https://www.blackhat.com/presentations/bh-dc-09/Marlinspike/BlackHat-DC- 09-Marlinspike-Defeating-SSL.pdf
[36]
M. Marlinspike. 2009. New Tricks for Defeating SSL in Practice. https://www.blackhat.com/presentations/bh-usa-09/Marlinspike/BHUSA09-Marlinspike-DefeatSSL-SLIDES.pdf
[37]
M. Marlinspike. 2009. Null Prefix Attacks against SSL/TLS Certificates. https://www.thoughtcrime.org/papers/null-prefix-attackes.pdf
[38]
Nikos Mavrogiannopoulos. 2016. GnuTLS. https://www.gnutls.org
[39]
NIST. 2017. CVE-2016-8495. https://nvd.nist.gov/vuln/detail/CVE-2016-8495
[40]
Georg Ofenbeck, Tiark Rompf, and Markus Püschel. 2016. RandIR: Differential Testing for Embedded Compilers. In Proceedings of the 2016 7th ACM SIGPLAN Symposium on Scala (SCALA 2016). Association for Computing Machinery, New York, NY, USA. 21–30. isbn:9781450346481 https://doi.org/10.1145/2998392.2998397
[41]
Theofilos Petsios, Adrian Tang, Salvatore Stolfo, Angelos D. Keromytis, and Suman Jana. 2017. NEZHA: Efficient Domain-Independent Differential Testing. In 2017 IEEE Symposium on Security and Privacy (SP ’17). 615–632. https://doi.org/10.1109/SP.2017.27
[42]
Lili Quan, Qianyu Guo, Hongxu Chen, Xiaofei Xie, Xiaohong Li, Yang Liu, and Jing Hu. 2020. SADT: Syntax-Aware Differential Testing of Certificate Validation in SSL/TLS Implementations. In 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE). 524–535. issn:2643-1572 https://doi.org/10.1145/3324884.3416552
[43]
Eric Rescorla. 2000. HTTP Over TLS. https://tools.ietf.org/html/rfc2818
[44]
Eric Rescorla. 2018. The Transport Layer Security (TLS) Protocol Version 1.3. https://tools.ietf.org/html/rfc8446
[45]
ZMap Team. 2017. ZCertificate. https://github.com/zmap/zcertificate
[46]
ZMap Team. 2018. ZLint. https://github.com/zmap/zlint
[47]
Cong Tian, Chu Chen, Zhenhua Duan, and Liang Zhao. 2019. Differential Testing of Certificate Validation in SSL/TLS Implementations: An RFC-Guided Approach. ACM Trans. Softw. Eng. Methodol., 28, 4 (2019), Article 24, Oct., 37 pages. issn:1049-331X https://doi.org/10.1145/3355048
[48]
Yibiao Yang, Yuming Zhou, Hao Sun, Zhendong Su, Zhiqiang Zuo, Lei Xu, and Baowen Xu. 2019. Hunting for Bugs in Code Coverage Tools via Randomized Differential Testing. In Proceedings of the 41st International Conference on Software Engineering (ICSE 2019). IEEE Press, 488–499. https://doi.org/10.1109/ICSE.2019.00061
[49]
Peter E. Yee. 2013. Updates to the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile. https://tools.ietf.org/html/rfc6818
[50]
ZCertificate. 2021. ZCertificate cannot represent duplicate extensions in JSON output. https://github.com/zmap/zcertificate/issues/23
[51]
ZCrypto. 2021. Lints: ZCrypto cannot represent the extension name Freshest CRL in JSON output. https://github.com/zmap/zcrypto/issues/244
[52]
ZCrypto. 2021. ZCrypto cannot parse dnQualifier in JSON output. https://github.com/zmap/zcrypto/issues/252
[53]
ZCrypto. 2021. ZCrypto cannot represent the extension name Policy Constraints in JSON output. https://github.com/zmap/zcrypto/issues/246
[54]
ZCrypto. 2021. ZCrypto cannot represent the extension Netscape Cert Type in JSON output. https://github.com/zmap/zcrypto/issues/248
[55]
ZCrypto. 2021. ZCrypto cannot represent the extension Policy Mappings in JSON output. https://github.com/zmap/zcrypto/issues/250
[56]
ZCrypto. 2021. ZCrypto cannot represent the extension Subject Information Access in JSON output. https://github.com/zmap/zcrypto/issues/247
[57]
ZCrypto. 2021. ZCrypto does not parse a authorityKeyId with value “0.”. https://github.com/zmap/zcrypto/issues/256
[58]
ZCrypto. 2021. ZCrypto does not parse the "critical" of certificatePolicies in JSON output. https://github.com/zmap/zcrypto/issues/255
[59]
ZCrypto. 2021. ZCrypto does not represent the “critical” of Issuer Alternative Name. https://github.com/zmap/zcrypto/issues/253
[60]
ZCrypto. 2021. ZCrypto does not represent the “critical” value of keyUsage and basicConstraints in JSON output. https://github.com/zmap/zcrypto/issues/245
[61]
ZCrypto. 2021. ZCrypto does not represent the ext name inhibitAnyPolicy in JSON output. https://github.com/zmap/zcrypto/issues/254
[62]
ZCrypto. 2021. ZCrypto parsed critical nameConstraints as non-critical. https://github.com/zmap/zcrypto/issues/251
[63]
ZLint. 2021. Lints: return detail for e_ext_duplicate_extension. https://github.com/zmap/zlint/issues/550
[64]
ZLint. 2021. Update e_ext_duplicate_extension error result with Details message. https://github.com/zmap/zlint/issues/549

Cited By

View all
  • (2024)ParsEval: Evaluation of Parsing Behavior using Real-world Out-in-the-wild X.509 CertificatesProceedings of the 19th International Conference on Availability, Reliability and Security10.1145/3664476.3669935(1-9)Online publication date: 30-Jul-2024
  • (2024)ARMOR: A Formally Verified Implementation of X.509 Certificate Chain Validation2024 IEEE Symposium on Security and Privacy (SP)10.1109/SP54263.2024.00220(1462-1480)Online publication date: 19-May-2024
  • (2024)Dynamic Differential Testing for Black-Box IPsec Implementations2024 9th International Symposium on Computer and Information Processing Technology (ISCIPT)10.1109/ISCIPT61983.2024.10673386(350-353)Online publication date: 24-May-2024
  • Show More Cited By

Index Terms

  1. SBDT: Search-Based Differential Testing of Certificate Parsers in SSL/TLS Implementations

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ISSTA 2023: Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis
    July 2023
    1554 pages
    ISBN:9798400702211
    DOI:10.1145/3597926
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 13 July 2023

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. SSL/TLS
    2. certificate parser
    3. differential testing
    4. search
    5. syntax tree model

    Qualifiers

    • Research-article

    Funding Sources

    Conference

    ISSTA '23
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 58 of 213 submissions, 27%

    Upcoming Conference

    ISSTA '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)73
    • Downloads (Last 6 weeks)8
    Reflects downloads up to 01 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)ParsEval: Evaluation of Parsing Behavior using Real-world Out-in-the-wild X.509 CertificatesProceedings of the 19th International Conference on Availability, Reliability and Security10.1145/3664476.3669935(1-9)Online publication date: 30-Jul-2024
    • (2024)ARMOR: A Formally Verified Implementation of X.509 Certificate Chain Validation2024 IEEE Symposium on Security and Privacy (SP)10.1109/SP54263.2024.00220(1462-1480)Online publication date: 19-May-2024
    • (2024)Dynamic Differential Testing for Black-Box IPsec Implementations2024 9th International Symposium on Computer and Information Processing Technology (ISCIPT)10.1109/ISCIPT61983.2024.10673386(350-353)Online publication date: 24-May-2024
    • (2023)Supporting Early-Safety Analysis of IoT Systems by Exploiting Testing Techniques2023 ACM/IEEE International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C)10.1109/MODELS-C59198.2023.00089(520-529)Online publication date: 1-Oct-2023

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media