certvalidator accept a certificate with version 1 and extension fields
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- cryptography, security
Research direction
Run the verify.py reproduction with ca.pem and seed.pem from test.zip, focusing on CertificateValidator and ValidationContext. Trace how the leaf certificate's version and extension fields are checked, then verify that the invalid chain is rejected while valid certificate chains continue to pass.
Written by the indexing model from the issue text.
Description
I have a certificate chain [rootCA,intermediate certificate,leaf certificate], which leaf certificate has extension fields and its version is 1. Clearly, leaf certificate violate Section 4.1.2.1, RFC5280: “When extensions are used, as expected in this profile, version MUST be 3 (value is 2). ”. Meanwhile, the chain can still pass certificate verification with certvalidator0.12.0.dev1 version.
To Reproduce:
import sys
from certvalidator import CertificateValidator, ValidationContext
def main():
if len(sys.argv) < 3:
sys.exit(1)
ca_path = sys.argv[1]
seed_path = sys.argv[2]
with open(ca_path, "rb") as f:
ca_bytes = f.read()
with open(seed_path, "rb") as f:
seed_bytes = f.read()
context = ValidationContext(
trust_roots=[ca_bytes],
allow_fetching=False,
crls=[],
ocsps=[]
)
validator = CertificateValidator(seed_bytes, validation_context=context)
validator.validate_usage(key_usage=set())
print("ok!")
if __name__ == "__main__":
main()
python3 verify.py ca.pem seed.pem
Expected behavior:
According to RFC 5280, it should be rejected.
- Dominant language
- Python
- Stars
- 117
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wbond/certvalidator
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wbond/certvalidator#46 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
wbond/certvalidator#44 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
wbond/certvalidator#22 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
wbond/certvalidator#11 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
wbond/certvalidator#56 · 1 comment ·
All issues in wbond/certvalidator
Similar issues
-
bug: conversation context selects the oldest thread messages instead of recent repliesPossibly taken @BLVCK-MAMBA-6 claimed this today. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AOSSIE-Org/SkillBot#74 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bad-antics/lateralus-lang#1438 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
area: control app
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
glossyio/traffic-monitor#415 ·
Maintainers usually reply within 1 day
-
apply_matrix_rect takes 6-9% of extract_text timePossibly taken @g4lb claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pdfminer/pdfminer.six#1333 ·
Maintainers usually reply within 1 day