BomLink accepts non-positive BOM versions and non-canonical shorthand UUIDs
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu từ src/main/java/org/cyclonedx/util/BomLink.java, nơi hàm khởi tạo BomLink(String) phân tích số serial và phiên bản, và nơi isBomLink kiểm tra tiền tố urn:cdx. Chạy repro trong issue trên nhánh master để xác nhận ba kết quả true. Pattern trong schema ở src/main/resources/bom-1.7.schema.json cho thấy các quy tắc cần khớp. Hoàn thành khi hàm khởi tạo ném BomLinkException và isBomLink trả về false với phiên bản 0, phiên bản âm và các UUID không có đúng 36 ký tự, đồng thời các test hiện có vẫn pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
BomLink and BomLink.isBomLink accept urn:cdx: URNs with zero or negative BOM versions (/0, /-5) and non-36-character shorthand UUIDs (1-1-1-1-1), disagreeing with the urn:cdx specification and CycloneDX's bomLinkDocumentType / bomLinkElementType schema definitions. Because fields such as vulnerabilities[].affects[].ref and externalReferences[].url union bomLink with refLinkType or iri-reference/xs:anyURI, schema validation lets malformed urn:cdx: strings through and callers rely on BomLink.isBomLink to distinguish valid BOM-Links.
cat > Repro.java <<'EOF'
import org.cyclonedx.util.BomLink;
public class Repro {
public static void main(String[] args) {
boolean v0 = BomLink.isBomLink("urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/0");
boolean vNeg = BomLink.isBomLink("urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/-5");
boolean shortUuid = BomLink.isBomLink("urn:cdx:1-1-1-1-1/1");
System.out.println("v0=" + v0 + " vNeg=" + vNeg + " shortUuid=" + shortUuid);
}
}
EOF
curl -fsSLO https://repo1.maven.org/maven2/org/cyclonedx/cyclonedx-core-java/13.5.0/cyclonedx-core-java-13.5.0.jar
javac -cp cyclonedx-core-java-13.5.0.jar Repro.java
java -cp .:cyclonedx-core-java-13.5.0.jar Repro
Actual output:
v0=true vNeg=true shortUuid=true
Expected v0=false vNeg=false shortUuid=false (and BomLinkException from new BomLink(...)), matching the IANA urn:cdx registration referenced in BomLink's Javadoc (bom-version >= 1 and 36-character RFC 9562 UUID) and bomLinkDocumentType / bomLinkElementType (^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*) in src/main/resources/bom-1.7.schema.json.
Verified on master (e591b11c6aaba7fa9cc859a9e9badfe3e1dd4cad, 13.6.0-SNAPSHOT) on Linux x86_64; BomLink.java is unchanged in release 13.5.0.
In src/main/java/org/cyclonedx/util/BomLink.java, BomLink(String) parses the serial number and version via UUID.fromString(...) and Integer.parseInt(parts[1]) without checking canonical 36-character UUID syntax or version >= 1.
Credit: https://ucsbplse.github.io/
- Ngôn ngữ chính
- Java
- Star
- 124
- Fork
- 97
- Merge trung bình
- 2 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CycloneDX/cyclonedx-core-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CycloneDX/cyclonedx-core-java#1001 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`license-mapping.json` maps classpath-exception license names to the deprecated SPDX id `GPL-2.0-with-classpath-exception`Có thể đã có người làm @afalhambra-hivemq đã nhận 5 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
CycloneDX/cyclonedx-core-java#998 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
CycloneDX/cyclonedx-core-java#902 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
CycloneDX/cyclonedx-core-java#848 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Partial serializationĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
CycloneDX/cyclonedx-core-java#838 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của CycloneDX/cyclonedx-core-java
Issue tương tự
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON stringCó thể đã có người làm @starryeye đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/java-sdk#1352 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
account bug course exam iris lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày