{"record":{"id":"619f43c2915ccf8c","repo":"google/tsunami-security-scanner","slug":"infinity-range-is-not-supported-got-s","errorCode":null,"errorMessage":"Infinity range is not supported, got '%s'","messagePattern":"Infinity range is not supported, got '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/com/google/tsunami/common/version/VersionRange.java","lineNumber":158,"sourceCode":"    String trimmedRange = rangeString.substring(1, rangeString.length() - 1).trim();\n\n    // No more parenthesis and brackets in the string.\n    if (CharMatcher.anyOf(\"[()]\").matchesAnyOf(trimmedRange)) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"Parenthesis and/or brackets not allowed within version range, got '%s'\",\n              rangeString));\n    }\n\n    // Only one comma that separates the minimum and maximum.\n    if (CharMatcher.is(',').countIn(trimmedRange) != 1) {\n      throw new IllegalArgumentException(\n          String.format(\"Invalid range of versions, got '%s'\", rangeString));\n    }\n\n    // Version range of minimum to maximum is not supported.\n    if (trimmedRange.equals(\",\")) {\n      throw new IllegalArgumentException(\n          String.format(\"Infinity range is not supported, got '%s'\", rangeString));\n    }\n  }\n}\n","sourceCodeStart":140,"sourceCodeEnd":163,"githubUrl":"https://github.com/google/tsunami-security-scanner/blob/363ba87b3543f8ae8e4304d3416818f03da7f262/common/src/main/java/com/google/tsunami/common/version/VersionRange.java#L140-L163","documentation":"VersionRange.parse rejects unbounded (open-ended) ranges: the inner string being exactly \",\" means both minimum and maximum were omitted (e.g. \"(,)\", \"[,]\"). The library requires at least one concrete bound, so it throws this IllegalArgumentException.","triggerScenarios":"Calling VersionRange.parse with \"[,]\", \"(,)\", \"[,)\", or \"(,]\" — any range where the inner string trims to just a comma.","commonSituations":"Users familiar with Maven or npm semver semantics try to express 'any version' with an open range; Tsunami fingerprints must instead enumerate versions with VersionSet or give explicit bounds.","solutions":["Provide at least one explicit bound, e.g. \"[1.0,)\" for '1.0 or later' if allowed by grammar, or concrete min/max.","Represent 'all versions' with a VersionSet built from the discrete versions you care about.","Pre-check with VersionRange.isValidVersionRange before parsing user-supplied ranges."],"exampleFix":"// before\nVersionRange.parse(\"[,)\"); // any version\n// after\nVersionRange.parse(\"[1.0,2.0]\");","handlingStrategy":"validation","validationCode":"String inner = rangeString.substring(1, rangeString.length()-1).trim(); if (!inner.equals(\",\")) { VersionRange.parse(rangeString); }","typeGuard":"boolean isBoundedRange(String s) { String i = s.substring(1, s.length()-1).trim(); return !i.equals(\",\"); }","tryCatchPattern":"try { VersionRange.parse(rangeString); } catch (IllegalArgumentException e) { log.error(\"Unbounded ranges unsupported: {}\", rangeString); }","preventionTips":["Never use [,] or (,) to mean 'any version'.","Give at least one concrete bound.","Model 'all versions' via VersionSet of discrete versions."],"tags":["version-range","parsing","illegal-argument"],"backgroundTag":"unsupported-operation","analyzedSha":"363ba87b3543f8ae8e4304d3416818f03da7f262","analyzedAt":"2026-09-13T01:50:53.990Z","contentChangedAt":"2026-09-13T01:50:53.990Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}