BomLink accepts non-positive BOM versions and non-canonical shorthand UUIDs
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 src/main/java/org/cyclonedx/util/BomLink.java 开始,这里的 BomLink(String) 构造函数会解析序列号和版本,isBomLink 会检查 urn:cdx 前缀。在 master 上运行 issue 中的复现步骤,确认三个 true 结果。src/main/resources/bom-1.7.schema.json 中的 schema pattern 展示了需要匹配的规则。完成的标准是:对于版本 0、负数版本以及长度不是 36 个字符的 UUID,构造函数抛出 BomLinkException,isBomLink 返回 false,并且现有测试全部通过。
由索引模型根据 Issue 内容生成。
描述
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/
- 主要语言
- Java
- 星标
- 124
- 派生
- 97
- 平均合并
- 2 天 14 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CycloneDX/cyclonedx-core-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
CycloneDX/cyclonedx-core-java#1001 ·
维护者通常 2 天内回复
-
`license-mapping.json` maps classpath-exception license names to the deprecated SPDX id `GPL-2.0-with-classpath-exception`可能已有人在做 @afalhambra-hivemq 于 5 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
CycloneDX/cyclonedx-core-java#998 ·
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
CycloneDX/cyclonedx-core-java#902 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 58/100
CycloneDX/cyclonedx-core-java#848 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
CycloneDX/cyclonedx-core-java#838 ·
维护者通常 2 天内回复
查看 CycloneDX/cyclonedx-core-java 的全部 Issue
相似的 Issue
-
crash
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Modern `HttpServletMcpTransport` does not check `Mcp-Name` when `params.name` or `params.uri` is not a JSON string可能已有人在做 @starryeye 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
modelcontextprotocol/java-sdk#1352 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 74/100
-
account bug course exam iris lecture
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复