Forge accept a certificate with version 1 and extension fields

Đang mở
#1,145 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
cryptography, security

Hướng nghiên cứu

Start at the pki.verifyCertificateChain call shown in verify.js and inspect how the leaf certificate's version and extension fields are validated. Reproduce the behavior with ca.pem and seed.pem from test.zip, then add coverage showing that a version 1 certificate with extensions fails verification and confirm the existing chain verification behavior remains intact.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I have a certificate chain [rootCA,intermediate certificate,leaf certificate], where the leaf certificate has an extended field with a version number of 1. This leaf certificate violates RFC5280 Section 4.1.2.1: "When using extended fields (as expected in this specification), the version number must be 3 (currently 2)." However, this certificate chain still passes Forge's certificate verification.

To Reproduce:

const { pki } = require('node-forge');
const { readFileSync } = require('fs');
const [, , caPath, certPath] = process.argv;
const caStore = pki.createCaStore([pki.certificateFromPem(readFileSync(caPath, 'utf8'))]);
const serverCert = pki.certificateFromPem(readFileSync(certPath, 'utf8'));
console.log(pki.verifyCertificateChain(caStore, [serverCert]));

node verify.js ca.pem seed.pem

Expected behavior:
Verification failed.

test.zip

Ngôn ngữ chính
JavaScript
Star
5.4k
Fork
875
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của digitalbazaar/forge

Tất cả issue của digitalbazaar/forge

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.