[{"data":1,"prerenderedAt":3181},["ShallowReactive",2],{"/blog/generic-semantic-version-processing":3,"navigation-en-us":2398,"banner-en-us":2826,"footer-en-us":2836,"blog-post-authors-en-us-Julian Thome":3080,"blog-related-posts-en-us-generic-semantic-version-processing":3094,"blog-promotions-en-us":3118,"next-steps-en-us":3171},{"id":4,"title":5,"authors":6,"body":8,"category":2378,"date":2379,"description":2380,"extension":2381,"externalUrl":2382,"faq":2382,"featured":2383,"heroImage":2384,"meta":2385,"navigation":1050,"path":2386,"seo":2387,"slug":2391,"stem":2392,"tags":2393,"template":2396,"updatedDate":2382,"__hash__":2397},"blogPosts/en-us/blog/generic-semantic-version-processing.md","SemVer versioning: how we handled it with linear interval arithmetic",[7],"Julian Thome",{"type":9,"value":10,"toc":2367},"minimark",[11,62,67,78,124,150,237,328,331,367,387,391,394,514,559,584,588,605,736,878,940,945,977,994,1095,1170,1316,1320,1372,1622,1634,1665,1669,1721,1735,1826,2017,2030,2034,2061,2131,2218,2246,2348,2352,2363],[12,13,14,15,21,22,27,28,33,34,39,40,45,46,49,50,55,56,61],"p",{},"The ",[16,17,20],"a",{"href":18,"rel":19},"https://semver.org/",[],"semantic versioning (SemVer) specification"," can be considered the de-facto standard for tracking software states during its evolution. Unfortunately, in reality many languages/ecosystems practice \"SemVer versioning\" and have not adopted the standard as-is; instead we can find many different semantic versioning flavors that are not necessarily compatible with the original SemVer spec. SemVer Versioning has led to the creation of a variety of different semantic versioning schemes.\nGitLab provides a ",[16,23,26],{"href":24,"rel":25},"https://docs.gitlab.com/user/application_security/dependency_scanning/",[],"Dependency Scanning (DS)","\nfeature that automatically detects vulnerabilities in the dependencies of a software project for a variety of different languages. DS relies on the ",[16,29,32],{"href":30,"rel":31},"https://gitlab.com/gitlab-org/security-products/gemnasium-db",[],"GitLab Advisory Database","\nthat is updated on a daily basis providing information about vulnerable packages that is expressed in the package-specific (native)\nsemantic version dialect. GitLab also recently launched an ",[16,35,38],{"href":36,"rel":37},"https://gitlab.com/gitlab-org/advisories-community",[],"Open Source Edition"," of the GitLab Advisory Database.\nAt GitLab we use a semi-automated process for advisory generation: we extract advisory data that includes package names and vulnerable versions from data-sources such as ",[16,41,44],{"href":42,"rel":43},"https://nvd.nist.gov/",[],"NVD"," and generate advisories that adhere to the GitLab advisory format before they are curated and stored in our ",[16,47,32],{"href":30,"rel":48},[],".\nThe plethora of SemVer versioning in the wild posed a major challenge for the level of automation we could apply in the advisory generation process: the different semantic version dialects prevented us from building generic mechanisms around version matching, version verification (i.e., the process of verifying whether or not versions are available on the relevant package registry), fixed version inference etc. Moreover, since advisory generation requires us to extract and update advisory data on scale from data-sources with hundreds of thousands vulnerability entries, translating and/or verifying versions by hand is not a viable, scalable solution.\nHaving a generic method to digest and process a variety of different SemVer versioning dialects was an important building block for automating large parts of the advisory generation process. This led to the development of ",[16,51,54],{"href":52,"rel":53},"https://gitlab.com/gitlab-org/vulnerability-research/foss/semver_dialects",[],"semver_dialects",", a utility that helps processing semantic versions in a generic, language-agnostic manner which has been recently open-sourced (MIT) and ",[16,57,60],{"href":58,"rel":59},"https://rubygems.org/gems/semver_dialects",[],"published on rubygems.org",".",[63,64,66],"h2",{"id":65},"understand-the-semver-spec","Understand the SemVer spec",[12,68,69,70,73,74,77],{},"The SemVer spec is the de-facto standard for tracking states of software projects during their evolution by associating unique, comparable version numbers to distinct states, and by encoding semantic properties into the semantic version strings so that a version change implicitly conveys information about the nature of the change.",[71,72],"br",{},"\nA semantic version consists of a prefix (version core) and a suffix that hold pre-release and/or build information. A version core consists of three numeric components that are delimited by ",[75,76,61],"code",{},":",[79,80,81,85,88],"ul",{},[82,83,84],"li",{},"major: backwards-incompatible changes",[82,86,87],{},"minor: new backwards-compatible functionality",[82,89,90,91,94,95,98,99,101,102,104,105,107,108,110,111,113,114,117,118,123],{},"patch: backwards-compatible bug fixes\nConsidering a software project using SemVer, with two releases ",[75,92,93],{},"1.0.0"," and ",[75,96,97],{},"1.0.1",", by just looking at the change applied to the semantic version strings, it is clear that ",[75,100,97],{}," is a newer (more recent) release of the software, whereas version ",[75,103,93],{}," is an older release. In addition, the version number ",[75,106,97],{}," represents an improved state of the software as compared to version ",[75,109,93],{}," which contained a bug that has been fixed in version ",[75,112,97],{},". This fix is signalled by the higher number of the patch version component.\nSemantic version processing is particularly useful in the context of ",[16,115,26],{"href":24,"rel":116},[],". DS is the process of automatically detecting (and potentially fixing)\nvulnerabilities related to the dependencies of a software project: dependencies of a software project are checked against a set of configuration files (so called advisories) that contain information about vulnerable dependencies; advisories usually include the versions of the vulnerable dependency.\nVulnerable versions are usually expressed in terms of version intervals: for example ",[16,119,122],{"href":120,"rel":121},"https://nvd.nist.gov/vuln/detail/CVE-2021-29560",[],"this out-of-bounds read vulnerability for the Python tensorflow package"," contains information about the vulnerable version by listing the four version intervals below:",[125,126,127,130,133,136],"ol",{},[82,128,129],{},"up to 2.1.4",[82,131,132],{},"from 2.2.0 up to 2.2.3",[82,134,135],{},"from 2.3.0 up to 2.3.3",[82,137,138,139,142,143,146,147,149],{},"from 2.4.0 up to 2.4.2\nWhile SemVer is very concise and clear about the syntax and semantic of semantic versions, it does not specify how to express and represent semantic version constraints. In addition, SemVer is purposefully simplistic to foster its adoption. In practice it seems as if many ecosystems required features that go beyond SemVer which led to the development of many SemVer versioning flavours as well as a variety of different native constraint matching syntaxes, some of which deviate from the official SemVer specification.  Depending on the ecosystem you are working with, the same semantic version string may be treated/interpreted differently: for example both Maven and pip/PyPI treat versions ",[75,140,141],{},"1.2.3.SP"," differently because pip/PyPI lacks the notion of an ",[75,144,145],{},"SP"," post release. Apart from that, ",[75,148,141],{}," cannot be considered a valid semantic version according to the SemVer spec.\nToday we have a variety of different semantic versioning schemes:",[79,151,152,163,173,183,193,203,213,223],{},[82,153,154,157,158],{},[75,155,156],{},"gem",": ",[16,159,162],{"href":160,"rel":161},"https://guides.rubygems.org/specification-reference/#add_runtime_dependency",[],"gem requirement",[82,164,165,157,168],{},[75,166,167],{},"maven",[16,169,172],{"href":170,"rel":171},"https://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification",[],"Maven Dependency Version Requirement Specification",[82,174,175,157,178],{},[75,176,177],{},"npm",[16,179,182],{"href":180,"rel":181},"https://github.com/npm/node-semver#ranges",[],"node-semver",[82,184,185,157,188],{},[75,186,187],{},"php",[16,189,192],{"href":190,"rel":191},"https://getcomposer.org/doc/articles/versions.md#writing-version-constraints",[],"PHP Composer version constraints",[82,194,195,157,198],{},[75,196,197],{},"pypi",[16,199,202],{"href":200,"rel":201},"https://www.python.org/dev/peps/pep-0440/#version-specifiers",[],"PEP440",[82,204,205,157,208],{},[75,206,207],{},"go",[16,209,212],{"href":210,"rel":211},"https://godoc.org/golang.org/x/tools/internal/semver",[],"go semver",[82,214,215,157,218],{},[75,216,217],{},"nuget",[16,219,222],{"href":220,"rel":221},"https://docs.microsoft.com/en-us/nuget/concepts/package-versioning",[],"NuGet semver",[82,224,225,157,228,232,233,236],{},[75,226,227],{},"conan",[16,229,231],{"href":180,"rel":230},[],"node-semver flavour","\nThis SemVer versioning fragmentation limited the degree of automation we could apply to our advisory extraction/generation process. This limitation motivated the development of a methodology and tool ",[16,234,54],{"href":52,"rel":235},[]," that helps to digest and process semantic versions in a language agnostic way and, hence, helps to reduce the manual advisory curation effort.\nBelow, you can see an excerpt of the advisory information that is extracted and generated by our semi-automated advisory generation process:",[238,239,244],"pre",{"className":240,"code":241,"language":242,"meta":243,"style":243},"language-yaml shiki shiki-themes github-light","# ...\naffected_range: \">=1.9,\u003C=2.7.1||==2.8\"\nfixed_versions:\n- \"2.7.2\"\n- \"2.8.1\"\nnot_impacted: \"All versions before 1.9, all versions after 2.7.1 before 2.8, all versions\n  after 2.8\"\nsolution: \"Upgrade to versions 2.7.2, 2.8.1 or above.\"\n# ...\n","yaml","",[75,245,246,255,269,278,287,295,306,312,323],{"__ignoreMap":243},[247,248,251],"span",{"class":249,"line":250},"line",1,[247,252,254],{"class":253},"sAwPA","# ...\n",[247,256,258,262,265],{"class":249,"line":257},2,[247,259,261],{"class":260},"shJU0","affected_range",[247,263,157],{"class":264},"sgsFI",[247,266,268],{"class":267},"sYBdl","\">=1.9,\u003C=2.7.1||==2.8\"\n",[247,270,272,275],{"class":249,"line":271},3,[247,273,274],{"class":260},"fixed_versions",[247,276,277],{"class":264},":\n",[247,279,281,284],{"class":249,"line":280},4,[247,282,283],{"class":264},"- ",[247,285,286],{"class":267},"\"2.7.2\"\n",[247,288,290,292],{"class":249,"line":289},5,[247,291,283],{"class":264},[247,293,294],{"class":267},"\"2.8.1\"\n",[247,296,298,301,303],{"class":249,"line":297},6,[247,299,300],{"class":260},"not_impacted",[247,302,157],{"class":264},[247,304,305],{"class":267},"\"All versions before 1.9, all versions after 2.7.1 before 2.8, all versions\n",[247,307,309],{"class":249,"line":308},7,[247,310,311],{"class":267},"  after 2.8\"\n",[247,313,315,318,320],{"class":249,"line":314},8,[247,316,317],{"class":260},"solution",[247,319,157],{"class":264},[247,321,322],{"class":267},"\"Upgrade to versions 2.7.2, 2.8.1 or above.\"\n",[247,324,326],{"class":249,"line":325},9,[247,327,254],{"class":253},[12,329,330],{},"In the excerpt above:",[79,332,333,338,343,348],{},[82,334,335,337],{},[75,336,261],{}," denotes the range of affected versions which is the machine-readable, native syntax used by the package manager/registry (in this case pypi).",[82,339,340,342],{},[75,341,274],{}," denotes the concrete versions when the vulnerability has been fixed.",[82,344,345,347],{},[75,346,300],{}," provides a textual description of the versions that are not affected.",[82,349,350,352,353,355,356,358,359,362,363,366],{},[75,351,317],{}," provides information about how to remediate the vulnerability.\nTo be able to extract and generate advisories like the one illustrated above in a language/ecosystem agnostic way, we implemented and open-sourced a generic semantic version representation and processing approach called semver_dialects.\nIn the advisory excerpt above, the ",[75,354,261],{}," field contains the version constraints in the native constraint syntax (in this case PyPI for Python); ",[75,357,274],{}," can be inferred by inverting the ",[75,360,361],{},"affected_version"," (i.e., non-affected versions) and by selecting the first available  version that falls into the range of non-affected versions from the native package registry; this step requires our approach to be able to parse the native semantic version syntax.\nIn order to deal with SemVer versioning and automatically process and generate the fields according to this description, our ",[16,364,54],{"href":52,"rel":365},[]," implementation had to satisfy the following requirements:",[125,368,369,372,375,378,381,384],{},[82,370,371],{},"Provide a unified interface to the language specific dialects.",[82,373,374],{},"Match semantic versions in a language agnostic way.",[82,376,377],{},"Invert ranges.",[82,379,380],{},"Cope with scattered, non-consecutive ranges.",[82,382,383],{},"Parse and produce different version syntaxes.",[82,385,386],{},"Parse and match versions/constraints in a best-effort manner.",[63,388,390],{"id":389},"semver-versioning-representation","SemVer versioning representation",[12,392,393],{},"First, we need a generic representation of a semantic version to start with. We assume that a semantic version is composed of prefix and suffix where the prefix contains segments for major, minor and patch version components as defined in the\nSemVer specification. The suffix may hold additional information about pre/post releases etc. As illustrated below, the major, minor and patch prefix segments can be accessed by means of the corresponding methods.",[238,395,399],{"className":396,"code":397,"language":398,"meta":243,"style":243},"language-ruby shiki shiki-themes github-light","s1 = SemanticVersion.new('1.2.3')\nputs \"segments: #{s1}\"\n# segments: 1:2:3\nputs \"major #{s1.major}\"\n# major 1\nputs \"minor #{s1.minor}\"\n# minor 2\nputs \"patch #{s1.patch}\"\n# patch 3\n","ruby",[75,400,401,429,443,448,467,472,488,493,509],{"__ignoreMap":243},[247,402,403,407,411,415,417,420,423,426],{"class":249,"line":250},[247,404,406],{"class":405},"sqxcx","s1",[247,408,410],{"class":409},"sD7c4"," =",[247,412,414],{"class":413},"sYu0t"," SemanticVersion",[247,416,61],{"class":264},[247,418,419],{"class":409},"new",[247,421,422],{"class":264},"(",[247,424,425],{"class":267},"'1.2.3'",[247,427,428],{"class":264},")\n",[247,430,431,434,437,440],{"class":249,"line":257},[247,432,433],{"class":413},"puts",[247,435,436],{"class":267}," \"segments: ",[247,438,439],{"class":267},"#{s1}",[247,441,442],{"class":267},"\"\n",[247,444,445],{"class":249,"line":271},[247,446,447],{"class":253},"# segments: 1:2:3\n",[247,449,450,452,455,458,462,465],{"class":249,"line":280},[247,451,433],{"class":413},[247,453,454],{"class":267}," \"major ",[247,456,457],{"class":267},"#{s1.",[247,459,461],{"class":460},"s7eDp","major",[247,463,464],{"class":267},"}",[247,466,442],{"class":267},[247,468,469],{"class":249,"line":289},[247,470,471],{"class":253},"# major 1\n",[247,473,474,476,479,481,484,486],{"class":249,"line":297},[247,475,433],{"class":413},[247,477,478],{"class":267}," \"minor ",[247,480,457],{"class":267},[247,482,483],{"class":460},"minor",[247,485,464],{"class":267},[247,487,442],{"class":267},[247,489,490],{"class":249,"line":308},[247,491,492],{"class":253},"# minor 2\n",[247,494,495,497,500,502,505,507],{"class":249,"line":314},[247,496,433],{"class":413},[247,498,499],{"class":267}," \"patch ",[247,501,457],{"class":267},[247,503,504],{"class":460},"patch",[247,506,464],{"class":267},[247,508,442],{"class":267},[247,510,511],{"class":249,"line":325},[247,512,513],{"class":253},"# patch 3\n",[12,515,516,517,520,521,94,524,527,528,532,533,536,537,539,540,543,544,547,548,551,552,94,555,558],{},"We cannot generally assume that all provided versions we would like to process fully adhere to the SemVer spec which requires a version prefix (core) to consist of three segments: major, minor and patch. Hence, per default, we remove redundant, trailing zeros from the prefix to ensure that ",[75,518,519],{},"2.0.0",", ",[75,522,523],{},"2.0",[75,525,526],{},"2"," are considered identical.\n",[16,529,531],{"href":52,"rel":530},[],"Semver_dialects"," translates language specific version suffixes into numeric values. This process can be described as version normalization.  For example the Maven (pre-)release candidate version ",[75,534,535],{},"2.0.0.RC1"," can be translated to a numeric representation with prefix: ",[75,538,526],{}," and suffix ",[75,541,542],{},"-1:1"," by mapping ",[75,545,546],{},"RC"," to a numeric value (in this example ",[75,549,550],{},"-1",") and, thus, rendering it numerically comparable.\nAfter this normalization step, semantic version matching for two versions ",[75,553,554],{},"vA",[75,556,557],{},"vB"," can be implemented by simply numerically comparing their segments in a pairwise fashion.  For unknown suffices that are not mappable to the numeric domain, we use lexical matching as a default fallback strategy.\nIn summary, comparing two semantic versions is a two-step process:",[125,560,561],{},[82,562,563,564,94,566,568,569,94,572,575,576,578,579,581,582,61],{},"Normalization: Extend both semantic versions to have the same prefix length and suffix lengths by appending zeros. 1. Comparison: Iterate over segments and compare each of them numerically.\nFor example, after normalizing the versions ",[75,565,535],{},[75,567,519],{}," to ",[75,570,571],{},"2:-1:1",[75,573,574],{},"2:0:0",", respectively, we can iterate over the segments (delimited by ",[75,577,77],{}," in the example) which we can compare numerically to successfully identify ",[75,580,571],{}," as being the smaller (release-candidate) version in comparison to ",[75,583,574],{},[63,585,587],{"id":586},"constraint-syntax-everything-is-a-linear-interval","Constraint syntax - everything is a linear interval",[12,589,590,591,594,595,598,599,94,601,604],{},"Translating semantic versions into a generic representation makes them numerically comparable which is already useful but not sufficient to express SemVer versioning constraints in a language-agnostic fashion.\nFor representing semantic version constraints in a generic way, we rely on linear intervals.  For the purpose of this blog, we define an interval as an ordered pair of two semantic versions which we are referring to as lower and upper bounds (or cuts). For the sake of simplicity, for the remainder of this section we will use simple integers as examples for lower and upper bounds, respectively.\nLinear intervals capture semantic version ranges symbolically which makes them very versatile and space efficient. At the same time, we can rely on well-established mathematical models borrowed from linear interval arithmetic that enable us to translate/express any type of constraint in terms of mathematical set operations on intervals.\nIn the table below you can find all the different types of intervals we considered to model semantic version constraints and a corresponding description where ",[75,592,593],{},"L"," stands for left, ",[75,596,597],{},"R"," stands for right with ",[75,600,16],{},[75,602,603],{},"b"," being the lower and upper bounds, respectively.",[606,607,608,624],"table",{},[609,610,611],"thead",{},[612,613,614,618,621],"tr",{},[615,616,617],"th",{},"Type of interval",[615,619,620],{},"Example",[615,622,623],{},"Description",[625,626,627,641,654,667,680,693,706],"tbody",{},[612,628,629,633,638],{},[630,631,632],"td",{},"LR-closed",[630,634,635],{},[75,636,637],{},"[a,b]: x >= a, x \u003C= b",[630,639,640],{},"all versions starting from a until b",[612,642,643,646,651],{},[630,644,645],{},"L-open R-closed",[630,647,648],{},[75,649,650],{},"(a,b]: x > a, x \u003C= b",[630,652,653],{},"all versions after a until b",[612,655,656,659,664],{},[630,657,658],{},"L-closed R-open",[630,660,661],{},[75,662,663],{},"[a,b): x >= a, x \u003C b",[630,665,666],{},"all versions starting from a before b",[612,668,669,672,677],{},[630,670,671],{},"LR-open",[630,673,674],{},[75,675,676],{},"(a,b): x > a, x \u003C b",[630,678,679],{},"all versions between a and b",[612,681,682,685,690],{},[630,683,684],{},"L-unbounded",[630,686,687],{},[75,688,689],{},"(-inf,b]: x \u003C= b",[630,691,692],{},"all versions until b",[612,694,695,698,703],{},[630,696,697],{},"R-unbounded",[630,699,700],{},[75,701,702],{},"[a,+inf): x >= a",[630,704,705],{},"all versions starting from a",[612,707,708,732,734],{},[630,709,710,711,714,715,718,719,722,723,726,727,731],{},"Below you can see example output for the different types of ranges from ",[16,712,54],{"href":52,"rel":713},[]," where we are using the ",[75,716,717],{},"VersionParser"," component to generate linear intervals from version constraints where ",[75,720,721],{},","," denotes a logical conjunction: e.g., ",[75,724,725],{},">=1, \u003C=2"," denotes the set of integers that are greater than or equal to 1 ",[728,729,730],"em",{},"and"," smaller than or equal to two, i.e., all integers/versions numbers starting from 1 until 2.",[630,733],{},[630,735],{},[238,737,739],{"className":396,"code":738,"language":398,"meta":243,"style":243},"puts VersionParser.parse(\">=1, \u003C=2\")\n# [1,2]\nputs VersionParser.parse(\">1, \u003C=2\")\n# (1,2]\nputs VersionParser.parse(\">=1, \u003C2\")\n# [1,2)\nputs VersionParser.parse(\">1, \u003C2\")\n# (1,2)\nputs VersionParser.parse(\"\u003C=2\")\n# (-inf,2]\nputs VersionParser.parse(\">=1\")\n# [1,+inf)\n",[75,740,741,760,765,782,787,804,809,826,831,848,854,872],{"__ignoreMap":243},[247,742,743,745,748,750,753,755,758],{"class":249,"line":250},[247,744,433],{"class":413},[247,746,747],{"class":413}," VersionParser",[247,749,61],{"class":264},[247,751,752],{"class":460},"parse",[247,754,422],{"class":264},[247,756,757],{"class":267},"\">=1, \u003C=2\"",[247,759,428],{"class":264},[247,761,762],{"class":249,"line":257},[247,763,764],{"class":253},"# [1,2]\n",[247,766,767,769,771,773,775,777,780],{"class":249,"line":271},[247,768,433],{"class":413},[247,770,747],{"class":413},[247,772,61],{"class":264},[247,774,752],{"class":460},[247,776,422],{"class":264},[247,778,779],{"class":267},"\">1, \u003C=2\"",[247,781,428],{"class":264},[247,783,784],{"class":249,"line":280},[247,785,786],{"class":253},"# (1,2]\n",[247,788,789,791,793,795,797,799,802],{"class":249,"line":289},[247,790,433],{"class":413},[247,792,747],{"class":413},[247,794,61],{"class":264},[247,796,752],{"class":460},[247,798,422],{"class":264},[247,800,801],{"class":267},"\">=1, \u003C2\"",[247,803,428],{"class":264},[247,805,806],{"class":249,"line":297},[247,807,808],{"class":253},"# [1,2)\n",[247,810,811,813,815,817,819,821,824],{"class":249,"line":308},[247,812,433],{"class":413},[247,814,747],{"class":413},[247,816,61],{"class":264},[247,818,752],{"class":460},[247,820,422],{"class":264},[247,822,823],{"class":267},"\">1, \u003C2\"",[247,825,428],{"class":264},[247,827,828],{"class":249,"line":314},[247,829,830],{"class":253},"# (1,2)\n",[247,832,833,835,837,839,841,843,846],{"class":249,"line":325},[247,834,433],{"class":413},[247,836,747],{"class":413},[247,838,61],{"class":264},[247,840,752],{"class":460},[247,842,422],{"class":264},[247,844,845],{"class":267},"\"\u003C=2\"",[247,847,428],{"class":264},[247,849,851],{"class":249,"line":850},10,[247,852,853],{"class":253},"# (-inf,2]\n",[247,855,857,859,861,863,865,867,870],{"class":249,"line":856},11,[247,858,433],{"class":413},[247,860,747],{"class":413},[247,862,61],{"class":264},[247,864,752],{"class":460},[247,866,422],{"class":264},[247,868,869],{"class":267},"\">=1\"",[247,871,428],{"class":264},[247,873,875],{"class":249,"line":874},12,[247,876,877],{"class":253},"# [1,+inf)\n",[12,879,880,881,886,887,94,890,893,894,94,897,900,901,520,904,907,908,910,911,520,914,907,917,919,920,94,923,926,927,930,931,934,935,94,937,939],{},"For solving SemVer versioning constraints, we use linear interval arithmetic which is explained in-depth in the text-book \"",[16,882,885],{"href":883,"rel":884},"https://epubs.siam.org/doi/book/10.1137/1.9780898717716?mobileUi=0&",[],"Introduction to Interval\nAnalysis",".\"\nAs mentioned earlier, for our purposes, we define an interval as an ordered pair of two semantic versions (lower and upper bound) that represents the set of all those semantic versions that are enclosed by lower and upper bounds.\nGiven that intervals are sets, we can perform standard set operations on them.\nIn the context of advisory generation, there are three operations we require to satisfy all the requirements we defined earlier: Intersection, Union and Complement.\nThe operations are explained in more detail in the sections below.\nFor the remainder of this section, we explain interval operations, using two example intervals ",[75,888,889],{},"X",[75,891,892],{},"Y"," with ",[75,895,896],{},"X=[x_l, x_u]",[75,898,899],{},"Y=[y_l, y_u]"," where ",[75,902,903],{},"x_l",[75,905,906],{},"x_u"," denote the lower and upper bounds for ",[75,909,889],{},", and ",[75,912,913],{},"y_l",[75,915,916],{},"y_u",[75,918,892],{},", respectively. In addition, we are using the ",[75,921,922],{},"min",[75,924,925],{},"max"," functions, where ",[75,928,929],{},"max(a,b)"," returns the largest and ",[75,932,933],{},"min(a,b)"," returns the smallest value of the parameters ",[75,936,16],{},[75,938,603],{},"; the ∅ symbol denotes the empty set.",[941,942,944],"h3",{"id":943},"intersection","Intersection",[12,946,947,948,950,951,953,954,950,956,958,959,94,961,963,964,967,968,94,970,972,973,976],{},"The recipe below illustrates how the intersection (",[75,949,889],{}," ∩ ",[75,952,892],{},") can be computed.\n",[75,955,889],{},[75,957,892],{}," = if ",[75,960,889],{},[75,962,892],{}," have points in common ",[75,965,966],{},"[max(x_l,y_l), min(x_u,y_u)]"," else ∅\nIntuitively, the intersection extracts the overlap (if any) from the two intervals ",[75,969,889],{},[75,971,892],{},".\nThe code snippet below shows how the intersection is computed in ",[16,974,54],{"href":52,"rel":975},[]," for the two examples:",[125,978,979,987],{},[82,980,981,950,984],{},[75,982,983],{},"[2,5]",[75,985,986],{},"[3,10]",[82,988,989,950,991],{},[75,990,983],{},[75,992,993],{},"[7,10]",[238,995,997],{"className":396,"code":996,"language":398,"meta":243,"style":243},"# 1. [2,5] ∩ [3,10] = [3, 5]\nputs VersionParser.parse(\">=2, \u003C=5\").intersect(VersionParser.parse(\">=3, \u003C=10\"))\n# [3,5]\n\n# 2. [2,5] ∩ [7,10] = ∅\nputs VersionParser.parse(\">=2, \u003C=5\").intersect(VersionParser.parse(\">=7, \u003C=10\"))\n# empty\n",[75,998,999,1004,1041,1046,1052,1057,1090],{"__ignoreMap":243},[247,1000,1001],{"class":249,"line":250},[247,1002,1003],{"class":253},"# 1. [2,5] ∩ [3,10] = [3, 5]\n",[247,1005,1006,1008,1010,1012,1014,1016,1019,1022,1025,1027,1029,1031,1033,1035,1038],{"class":249,"line":257},[247,1007,433],{"class":413},[247,1009,747],{"class":413},[247,1011,61],{"class":264},[247,1013,752],{"class":460},[247,1015,422],{"class":264},[247,1017,1018],{"class":267},"\">=2, \u003C=5\"",[247,1020,1021],{"class":264},").",[247,1023,1024],{"class":460},"intersect",[247,1026,422],{"class":264},[247,1028,717],{"class":413},[247,1030,61],{"class":264},[247,1032,752],{"class":460},[247,1034,422],{"class":264},[247,1036,1037],{"class":267},"\">=3, \u003C=10\"",[247,1039,1040],{"class":264},"))\n",[247,1042,1043],{"class":249,"line":271},[247,1044,1045],{"class":253},"# [3,5]\n",[247,1047,1048],{"class":249,"line":280},[247,1049,1051],{"emptyLinePlaceholder":1050},true,"\n",[247,1053,1054],{"class":249,"line":289},[247,1055,1056],{"class":253},"# 2. [2,5] ∩ [7,10] = ∅\n",[247,1058,1059,1061,1063,1065,1067,1069,1071,1073,1075,1077,1079,1081,1083,1085,1088],{"class":249,"line":297},[247,1060,433],{"class":413},[247,1062,747],{"class":413},[247,1064,61],{"class":264},[247,1066,752],{"class":460},[247,1068,422],{"class":264},[247,1070,1018],{"class":267},[247,1072,1021],{"class":264},[247,1074,1024],{"class":460},[247,1076,422],{"class":264},[247,1078,717],{"class":413},[247,1080,61],{"class":264},[247,1082,752],{"class":460},[247,1084,422],{"class":264},[247,1086,1087],{"class":267},"\">=7, \u003C=10\"",[247,1089,1040],{"class":264},[247,1091,1092],{"class":249,"line":308},[247,1093,1094],{"class":253},"# empty\n",[12,1096,1097,1098,1101,1102,1105,1106,1110,1111,1113,1114,1117,1118,950,1121,1123,1124,1126,1127,1129,1130,1133,1134,1137,1138,900,1141,1144,1145,1147,1148,1151,1152,1155,1156,94,1158,1161,1162,1165,1166,1169],{},"The intersection operation is useful to perform semantic version matching for checking whether semantic version falls into a certain version interval or range. For instance we may want to check whether version ",[75,1099,1100],{},"1.2.3"," satisfies the constraint ",[75,1103,1104],{},">=1.0.0, \u003C1.2.4",". In the context of ",[16,1107,1109],{"href":24,"rel":1108},[],"Dependency Scanning",", these types of constraints are very common. The problem ",[75,1112,1100],{}," ∈ ",[75,1115,1116],{},"[1.0.0, 1.2.4)"," can be translated to a set intersection: ",[75,1119,1120],{},"[1.2.3, 1.2.3]",[75,1122,1116],{}," = ",[75,1125,1120],{},"  which returns a non-empty set and, hence, tells us that version ",[75,1128,1100],{}," satisfies the given version constraints.\nIn the context of our advisory generation process, we use intersection to cross-validate versions from vulnerability reports (CVEs) with versions of the available package that are available on the package registry that serves it.\nFor convenience, as mentioned earlier, ",[16,1131,54],{"href":52,"rel":1132},[]," also supports grouping intervals into ranges by means of the ",[75,1135,1136],{},"VersionRange"," class. A range is a set of intervals which we denote with ",[75,1139,1140],{},"{I0, I1, ..., IN}",[75,1142,1143],{},"I"," denotes version intervals delimited by ",[75,1146,721],{}," which can be interpreted as a union operator (explained in the next section).\nA range is a set of intervals. In the example below, we first create a range ",[75,1149,1150],{},"r1"," to which we are adding two intervals: ",[75,1153,1154],{},"r1 = {[2.2.1, 5.1.2], (3.1, 10)}",".\nAfter that, there is a check for an overlap (i.e., an intersection) between ",[75,1157,1150],{},[75,1159,1160],{},"[0, 2.1)"," (no overlap) as well as ",[75,1163,1164],{},"[5.5, 5.5]"," (overlap). You can see the output of ",[16,1167,54],{"href":52,"rel":1168},[]," in the excerpt below.",[238,1171,1173],{"className":396,"code":1172,"language":398,"meta":243,"style":243},"r1 = VersionRange.new\nr1.add(VersionParser.parse(\">=2.1.2, \u003C=5.1.2\"))\nr1.add(VersionParser.parse(\">3.1, \u003C10\"))\n\nputs \"[0,2.1) in #{r1}? #{r1.overlaps_with?(VersionParser.parse(\">=0, \u003C2.1\"))}\"\n# [0,2.1) in [2.1.2,5.1.2],(3.1,10)? false\nputs \"[5.5,5.5] overlap with #{r1}? #{r1.overlaps_with?(VersionParser.parse(\"=5.5\"))}\"\n# [5.5,5.5] overlap with [2.1.2,5.1.2],(3.1,10)? true\n",[75,1174,1175,1189,1212,1233,1237,1274,1279,1311],{"__ignoreMap":243},[247,1176,1177,1179,1181,1184,1186],{"class":249,"line":250},[247,1178,1150],{"class":405},[247,1180,410],{"class":409},[247,1182,1183],{"class":413}," VersionRange",[247,1185,61],{"class":264},[247,1187,1188],{"class":409},"new\n",[247,1190,1191,1194,1197,1199,1201,1203,1205,1207,1210],{"class":249,"line":257},[247,1192,1193],{"class":264},"r1.",[247,1195,1196],{"class":460},"add",[247,1198,422],{"class":264},[247,1200,717],{"class":413},[247,1202,61],{"class":264},[247,1204,752],{"class":460},[247,1206,422],{"class":264},[247,1208,1209],{"class":267},"\">=2.1.2, \u003C=5.1.2\"",[247,1211,1040],{"class":264},[247,1213,1214,1216,1218,1220,1222,1224,1226,1228,1231],{"class":249,"line":271},[247,1215,1193],{"class":264},[247,1217,1196],{"class":460},[247,1219,422],{"class":264},[247,1221,717],{"class":413},[247,1223,61],{"class":264},[247,1225,752],{"class":460},[247,1227,422],{"class":264},[247,1229,1230],{"class":267},"\">3.1, \u003C10\"",[247,1232,1040],{"class":264},[247,1234,1235],{"class":249,"line":280},[247,1236,1051],{"emptyLinePlaceholder":1050},[247,1238,1239,1241,1244,1247,1250,1253,1256,1258,1260,1262,1264,1266,1269,1272],{"class":249,"line":289},[247,1240,433],{"class":413},[247,1242,1243],{"class":267}," \"[0,2.1) in ",[247,1245,1246],{"class":267},"#{r1}",[247,1248,1249],{"class":267},"? ",[247,1251,1252],{"class":267},"#{r1.",[247,1254,1255],{"class":460},"overlaps_with?",[247,1257,422],{"class":267},[247,1259,717],{"class":413},[247,1261,61],{"class":267},[247,1263,752],{"class":460},[247,1265,422],{"class":267},[247,1267,1268],{"class":267},"\">=0, \u003C2.1\"",[247,1270,1271],{"class":267},"))}",[247,1273,442],{"class":267},[247,1275,1276],{"class":249,"line":297},[247,1277,1278],{"class":253},"# [0,2.1) in [2.1.2,5.1.2],(3.1,10)? false\n",[247,1280,1281,1283,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1307,1309],{"class":249,"line":308},[247,1282,433],{"class":413},[247,1284,1285],{"class":267}," \"[5.5,5.5] overlap with ",[247,1287,1246],{"class":267},[247,1289,1249],{"class":267},[247,1291,1252],{"class":267},[247,1293,1255],{"class":460},[247,1295,422],{"class":267},[247,1297,717],{"class":413},[247,1299,61],{"class":267},[247,1301,752],{"class":460},[247,1303,422],{"class":267},[247,1305,1306],{"class":267},"\"=5.5\"",[247,1308,1271],{"class":267},[247,1310,442],{"class":267},[247,1312,1313],{"class":249,"line":314},[247,1314,1315],{"class":253},"# [5.5,5.5] overlap with [2.1.2,5.1.2],(3.1,10)? true\n",[941,1317,1319],{"id":1318},"union","Union",[12,1321,1322,1323,1325,1326,953,1328,1325,1330,958,1332,94,1334,963,1336,1339,1340,1343,1344,1347,1348,1325,1350,1123,1352,1123,1355,1358,1359,1325,1361,1123,1363,1366,1367,94,1369,1371],{},"The recipe below illustrates how the union (",[75,1324,889],{}," ∪ ",[75,1327,892],{},[75,1329,889],{},[75,1331,892],{},[75,1333,889],{},[75,1335,892],{},[75,1337,1338],{},"{[min(x_l,y_l), max(x_u,y_u)]}"," else ",[75,1341,1342],{},"{X,Y}","\nThe code snippet below shows how the union can be computed with ",[16,1345,54],{"href":52,"rel":1346},[]," for the two examples: 1. ",[75,1349,983],{},[75,1351,986],{},[75,1353,1354],{},"{[2,5], [3,10]}",[75,1356,1357],{},"{[2, 10]}","\n2. ",[75,1360,983],{},[75,1362,993],{},[75,1364,1365],{},"{[2,5], [7,10]}","\nWith the union operator, we can collapse version intervals in case they have an overlap/intersection; otherwise, if ",[75,1368,889],{},[75,1370,892],{}," are disjoint, we add their intervals directly to the range.",[238,1373,1375],{"className":396,"code":1374,"language":398,"meta":243,"style":243},"# 1. [2,5] ∪ [3,10] = [2, 10]\nputs \"union: #{VersionParser.parse(\">=2, \u003C=5\").union(VersionParser.parse(\">=3, \u003C=10\"))}\"\n# union: [2,10]\n\n# Version ranges perform union two for the purpose of automatically collapsing\n# intervals (if possible)\nr1 = VersionRange.new\nr1.add(VersionParser.parse(\">=2, \u003C=5\"))\nr1.add(VersionParser.parse(\">=3, \u003C=10\"))\nputs \"r1: #{r1}\"\n# union: [2,5],[3,10]\nputs \"r1 collapsed: #{r1.collapse}\" # creates the union between intervals\n# r1 collapsed: [2,10]\n\n# 2. [2,5] ∪ [7,10] = {[2, 10], [7,10]}\nr2 = VersionRange.new\nr2.add(VersionParser.parse(\">=2, \u003C=5\"))\nr2.add(VersionParser.parse(\">=7, \u003C=10\"))\nputs \"r2: #{r2}\"\n# r2: [2,5],[7,10]\n",[75,1376,1377,1382,1422,1427,1431,1436,1441,1453,1473,1493,1504,1509,1529,1535,1540,1546,1560,1582,1603,1616],{"__ignoreMap":243},[247,1378,1379],{"class":249,"line":250},[247,1380,1381],{"class":253},"# 1. [2,5] ∪ [3,10] = [2, 10]\n",[247,1383,1384,1386,1389,1392,1394,1396,1398,1400,1402,1404,1406,1408,1410,1412,1414,1416,1418,1420],{"class":249,"line":257},[247,1385,433],{"class":413},[247,1387,1388],{"class":267}," \"union: ",[247,1390,1391],{"class":267},"#{",[247,1393,717],{"class":413},[247,1395,61],{"class":267},[247,1397,752],{"class":460},[247,1399,422],{"class":267},[247,1401,1018],{"class":267},[247,1403,1021],{"class":267},[247,1405,1318],{"class":460},[247,1407,422],{"class":267},[247,1409,717],{"class":413},[247,1411,61],{"class":267},[247,1413,752],{"class":460},[247,1415,422],{"class":267},[247,1417,1037],{"class":267},[247,1419,1271],{"class":267},[247,1421,442],{"class":267},[247,1423,1424],{"class":249,"line":271},[247,1425,1426],{"class":253},"# union: [2,10]\n",[247,1428,1429],{"class":249,"line":280},[247,1430,1051],{"emptyLinePlaceholder":1050},[247,1432,1433],{"class":249,"line":289},[247,1434,1435],{"class":253},"# Version ranges perform union two for the purpose of automatically collapsing\n",[247,1437,1438],{"class":249,"line":297},[247,1439,1440],{"class":253},"# intervals (if possible)\n",[247,1442,1443,1445,1447,1449,1451],{"class":249,"line":308},[247,1444,1150],{"class":405},[247,1446,410],{"class":409},[247,1448,1183],{"class":413},[247,1450,61],{"class":264},[247,1452,1188],{"class":409},[247,1454,1455,1457,1459,1461,1463,1465,1467,1469,1471],{"class":249,"line":314},[247,1456,1193],{"class":264},[247,1458,1196],{"class":460},[247,1460,422],{"class":264},[247,1462,717],{"class":413},[247,1464,61],{"class":264},[247,1466,752],{"class":460},[247,1468,422],{"class":264},[247,1470,1018],{"class":267},[247,1472,1040],{"class":264},[247,1474,1475,1477,1479,1481,1483,1485,1487,1489,1491],{"class":249,"line":325},[247,1476,1193],{"class":264},[247,1478,1196],{"class":460},[247,1480,422],{"class":264},[247,1482,717],{"class":413},[247,1484,61],{"class":264},[247,1486,752],{"class":460},[247,1488,422],{"class":264},[247,1490,1037],{"class":267},[247,1492,1040],{"class":264},[247,1494,1495,1497,1500,1502],{"class":249,"line":850},[247,1496,433],{"class":413},[247,1498,1499],{"class":267}," \"r1: ",[247,1501,1246],{"class":267},[247,1503,442],{"class":267},[247,1505,1506],{"class":249,"line":856},[247,1507,1508],{"class":253},"# union: [2,5],[3,10]\n",[247,1510,1511,1513,1516,1518,1521,1523,1526],{"class":249,"line":874},[247,1512,433],{"class":413},[247,1514,1515],{"class":267}," \"r1 collapsed: ",[247,1517,1252],{"class":267},[247,1519,1520],{"class":460},"collapse",[247,1522,464],{"class":267},[247,1524,1525],{"class":267},"\"",[247,1527,1528],{"class":253}," # creates the union between intervals\n",[247,1530,1532],{"class":249,"line":1531},13,[247,1533,1534],{"class":253},"# r1 collapsed: [2,10]\n",[247,1536,1538],{"class":249,"line":1537},14,[247,1539,1051],{"emptyLinePlaceholder":1050},[247,1541,1543],{"class":249,"line":1542},15,[247,1544,1545],{"class":253},"# 2. [2,5] ∪ [7,10] = {[2, 10], [7,10]}\n",[247,1547,1549,1552,1554,1556,1558],{"class":249,"line":1548},16,[247,1550,1551],{"class":405},"r2",[247,1553,410],{"class":409},[247,1555,1183],{"class":413},[247,1557,61],{"class":264},[247,1559,1188],{"class":409},[247,1561,1563,1566,1568,1570,1572,1574,1576,1578,1580],{"class":249,"line":1562},17,[247,1564,1565],{"class":264},"r2.",[247,1567,1196],{"class":460},[247,1569,422],{"class":264},[247,1571,717],{"class":413},[247,1573,61],{"class":264},[247,1575,752],{"class":460},[247,1577,422],{"class":264},[247,1579,1018],{"class":267},[247,1581,1040],{"class":264},[247,1583,1585,1587,1589,1591,1593,1595,1597,1599,1601],{"class":249,"line":1584},18,[247,1586,1565],{"class":264},[247,1588,1196],{"class":460},[247,1590,422],{"class":264},[247,1592,717],{"class":413},[247,1594,61],{"class":264},[247,1596,752],{"class":460},[247,1598,422],{"class":264},[247,1600,1087],{"class":267},[247,1602,1040],{"class":264},[247,1604,1606,1608,1611,1614],{"class":249,"line":1605},19,[247,1607,433],{"class":413},[247,1609,1610],{"class":267}," \"r2: ",[247,1612,1613],{"class":267},"#{r2}",[247,1615,442],{"class":267},[247,1617,1619],{"class":249,"line":1618},20,[247,1620,1621],{"class":253},"# r2: [2,5],[7,10]\n",[12,1623,1624,1625,1628,1629,1633],{},"In the context of ",[16,1626,1109],{"href":24,"rel":1627},[],", vulnerability data usually lists a set of intervals for dependencies that are susceptible to a given vulnerability like the ",[16,1630,1632],{"href":120,"rel":1631},[],"tensorflow example"," in the introduction where the following versions are affected:",[125,1635,1636,1638,1640,1642],{},[82,1637,129],{},[82,1639,132],{},[82,1641,135],{},[82,1643,1644,1645,1647,1648,1650,1651,1653,1654,1656,1657,1660,1661,1664],{},"from 2.4.0 up to 2.4.2\nThis list of intervals can be represented as a single range (",[75,1646,1136],{},") by combining all of the mentioned version intervals through the union operator.\nIn the Ruby code example above, you can also see the ",[75,1649,1520],{}," method which is invoked on a ",[75,1652,1136],{}," object. This method automatically collapses overlapping intervals that are included in the same ",[75,1655,1136],{}," to eliminate redundant intervals. Collapsing the range ",[75,1658,1659],{},"{[2, 5], [3, 10]}"," yields a new range ",[75,1662,1663],{},"{[2,10]}"," with only one interval while preserving semantic equivalence.",[941,1666,1668],{"id":1667},"complement","Complement",[12,1670,1671,1672,1674,1675,953,1677,1674,1679,157,1681,1684,1685,950,1687,1689,1690,1693,1694,1696,1697,1700,1701,428,1703,1706,1707,1700,1709,428,1711,1706,1714,1693,1716,428,1718],{},"The recipe below, illustrates how the relative complement (",[75,1673,889],{}," - ",[75,1676,892],{},[75,1678,889],{},[75,1680,892],{},[75,1682,1683],{},"Z"," := ",[75,1686,889],{},[75,1688,892],{},"; if (",[75,1691,1692],{},"z_l"," > ",[75,1695,903],{}," && ",[75,1698,1699],{},"z_u"," \u003C ",[75,1702,906],{},[75,1704,1705],{},"{[x_l, z_l),(z_u, x_u]}"," else if (",[75,1708,903],{},[75,1710,1692],{},[75,1712,1713],{},"{[x_l, z_l)}",[75,1715,906],{},[75,1717,1699],{},[75,1719,1720],{},"{(z_u, x_u]}",[12,1722,1723,1724,1726,1727,94,1729,1731,1732,1734],{},"Intuitively, this recipe computes the intersection (",[75,1725,1683],{},") between ",[75,1728,889],{},[75,1730,892],{}," and removes all elements from ",[75,1733,889],{}," that are included in the intersection. The examples below illustrate the recipe:",[125,1736,1737,1759,1779],{},[82,1738,1739,1674,1742,1745,1746,1123,1748,1751,1752,1755,1756],{},[75,1740,1741],{},"[3, 5]",[75,1743,1744],{},"[1, 3]",": with ",[75,1747,1683],{},[75,1749,1750],{},"[3, 3]"," we get ",[75,1753,1754],{},"{(3, 5]}"," which is\nequivalent to ",[75,1757,1758],{},"{[4, 5]}",[82,1760,1761,1674,1764,1745,1767,1123,1769,1751,1772,1775,1776],{},[75,1762,1763],{},"[3, 10]",[75,1765,1766],{},"[10, 11]",[75,1768,1683],{},[75,1770,1771],{},"[10, 10]",[75,1773,1774],{},"{[3, 10)}"," which is equivalent to ",[75,1777,1778],{},"{[3, 9]}",[82,1780,1781,1674,1784,1745,1787,1123,1789,1751,1791,1775,1794,1797,1798,1674,1800,1802,1803,1805,1806,1809,1810,1123,1813,1674,1815,1817,1818,1821,1822,1825],{},[75,1782,1783],{},"[1, 5]",[75,1785,1786],{},"[2, 2]",[75,1788,1683],{},[75,1790,1786],{},[75,1792,1793],{},"[1, 2), (2, 5]",[75,1795,1796],{},"{[1, 1], [3, 5]}","\nWith the recipe above, we can also compute the absolute complement ",[75,1799,889],{},[75,1801,892],{}," by assuming ",[75,1804,889],{}," is the universe that captures the entirety of all possible values:\n",[75,1807,1808],{},"(-inf,+inf)",". The universal complement can be defined as ",[75,1811,1812],{},"~X",[75,1814,1808],{},[75,1816,889],{},".\nWith ",[16,1819,54],{"href":52,"rel":1820},[],", the absolute complement can be computed by means of the ",[75,1823,1824],{},"invert"," method as illustrated in the example below.",[238,1827,1829],{"className":396,"code":1828,"language":398,"meta":243,"style":243},"# example 1: ~[1,3] = {(-inf,0],[4, +inf)} = {(-inf,1),(3,+inf)}\nr1 = VersionRange.new\nr1.add(VersionParser.parse(\">=1, \u003C=3\"))\nputs r1.invert\n# (-inf,1),(3,+inf)\n\n# example 2: ~{[2.1.2, 5.1.2], (3.1, 10)} = ~{[2.1.2, 10)} = {(-inf,2.1.2),[10,+inf)}\n{(-inf,0],[4, +inf)} = {(-inf,1),(3,+inf)}\nr2 = VersionRange.new\nr2.add(VersionParser.parse(\">=2.1.2, \u003C=5.1.2\"))\nr2.add(VersionParser.parse(\">3.1, \u003C10\"))\nputs r2.collapse.invert\n# (-inf,2.1.2),[10,+inf)\n",[75,1830,1831,1836,1848,1869,1879,1884,1888,1893,1947,1959,1979,1999,2012],{"__ignoreMap":243},[247,1832,1833],{"class":249,"line":250},[247,1834,1835],{"class":253},"# example 1: ~[1,3] = {(-inf,0],[4, +inf)} = {(-inf,1),(3,+inf)}\n",[247,1837,1838,1840,1842,1844,1846],{"class":249,"line":257},[247,1839,1150],{"class":405},[247,1841,410],{"class":409},[247,1843,1183],{"class":413},[247,1845,61],{"class":264},[247,1847,1188],{"class":409},[247,1849,1850,1852,1854,1856,1858,1860,1862,1864,1867],{"class":249,"line":271},[247,1851,1193],{"class":264},[247,1853,1196],{"class":460},[247,1855,422],{"class":264},[247,1857,717],{"class":413},[247,1859,61],{"class":264},[247,1861,752],{"class":460},[247,1863,422],{"class":264},[247,1865,1866],{"class":267},"\">=1, \u003C=3\"",[247,1868,1040],{"class":264},[247,1870,1871,1873,1876],{"class":249,"line":280},[247,1872,433],{"class":413},[247,1874,1875],{"class":264}," r1.",[247,1877,1878],{"class":460},"invert\n",[247,1880,1881],{"class":249,"line":289},[247,1882,1883],{"class":253},"# (-inf,1),(3,+inf)\n",[247,1885,1886],{"class":249,"line":297},[247,1887,1051],{"emptyLinePlaceholder":1050},[247,1889,1890],{"class":249,"line":308},[247,1891,1892],{"class":253},"# example 2: ~{[2.1.2, 5.1.2], (3.1, 10)} = ~{[2.1.2, 10)} = {(-inf,2.1.2),[10,+inf)}\n",[247,1894,1895,1898,1901,1904,1907,1910,1913,1915,1918,1921,1924,1927,1929,1931,1934,1937,1940,1942,1944],{"class":249,"line":314},[247,1896,1897],{"class":264},"{(",[247,1899,1900],{"class":409},"-",[247,1902,1903],{"class":264},"inf,",[247,1905,1906],{"class":413},"0",[247,1908,1909],{"class":264},"],[",[247,1911,1912],{"class":413},"4",[247,1914,520],{"class":264},[247,1916,1917],{"class":409},"+",[247,1919,1920],{"class":264},"inf)} ",[247,1922,1923],{"class":409},"=",[247,1925,1926],{"class":264}," {(",[247,1928,1900],{"class":409},[247,1930,1903],{"class":264},[247,1932,1933],{"class":413},"1",[247,1935,1936],{"class":264},"),(",[247,1938,1939],{"class":413},"3",[247,1941,721],{"class":264},[247,1943,1917],{"class":409},[247,1945,1946],{"class":264},"inf)}\n",[247,1948,1949,1951,1953,1955,1957],{"class":249,"line":325},[247,1950,1551],{"class":405},[247,1952,410],{"class":409},[247,1954,1183],{"class":413},[247,1956,61],{"class":264},[247,1958,1188],{"class":409},[247,1960,1961,1963,1965,1967,1969,1971,1973,1975,1977],{"class":249,"line":850},[247,1962,1565],{"class":264},[247,1964,1196],{"class":460},[247,1966,422],{"class":264},[247,1968,717],{"class":413},[247,1970,61],{"class":264},[247,1972,752],{"class":460},[247,1974,422],{"class":264},[247,1976,1209],{"class":267},[247,1978,1040],{"class":264},[247,1980,1981,1983,1985,1987,1989,1991,1993,1995,1997],{"class":249,"line":856},[247,1982,1565],{"class":264},[247,1984,1196],{"class":460},[247,1986,422],{"class":264},[247,1988,717],{"class":413},[247,1990,61],{"class":264},[247,1992,752],{"class":460},[247,1994,422],{"class":264},[247,1996,1230],{"class":267},[247,1998,1040],{"class":264},[247,2000,2001,2003,2006,2008,2010],{"class":249,"line":874},[247,2002,433],{"class":413},[247,2004,2005],{"class":264}," r2.",[247,2007,1520],{"class":460},[247,2009,61],{"class":264},[247,2011,1878],{"class":460},[247,2013,2014],{"class":249,"line":1531},[247,2015,2016],{"class":253},"# (-inf,2.1.2),[10,+inf)\n",[12,2018,1624,2019,2022,2023,2025,2026,2029],{},[16,2020,1109],{"href":24,"rel":2021},[],", this functionality is used to automatically infer non-affected versions from the affected versions information: if ",[75,2024,1744],{}," represents all the affected versions of a vulnerable package, its complement ",[75,2027,2028],{},"{(-inf,1),(3,+inf)}",", per definition, captures only the unaffected version. In our advisory generation process we cross-validate the version information of packages from the package registries with this information about unaffected versions to check whether or not unaffected packages are available; if this is the case, we add the corresponding remediation information to the generated advisories.",[63,2031,2033],{"id":2032},"version-translation","Version Translation",[12,2035,2036,2037,2040,2041,2044,2045,2047,2048,2050,2051,2053,2054,900,2057,2060],{},"Linear interval arithmetic provides us with all the means necessary to represent and solve SemVer versioning constraints in a language-agnostic way.\nHowever, in order to leverage the generic representation, we have to be able to automatically translate the native semantic version dialects into the generic representation and vice versa. The details of this translation functionality are provided below.\n",[16,2038,531],{"href":52,"rel":2039},[]," offers a ",[75,2042,2043],{},"VersionTranslator"," class. The ",[75,2046,2043],{}," takes a native semantic version constraint, and translates it into an intermediate string representation that can then be translated into a range (",[75,2049,1136],{},") by using the ",[75,2052,717],{},". Currently semver_dialects supports all the syntax listed below by invoking ",[75,2055,2056],{},"translate_\u003Cpackage_type>",[75,2058,2059],{},"\u003Cpackage_type>"," is one of:",[79,2062,2063,2070,2077,2084,2092,2099,2106,2113],{},[82,2064,2065,157,2067],{},[75,2066,156],{},[16,2068,162],{"href":160,"rel":2069},[],[82,2071,2072,157,2074],{},[75,2073,167],{},[16,2075,172],{"href":170,"rel":2076},[],[82,2078,2079,157,2081],{},[75,2080,177],{},[16,2082,182],{"href":180,"rel":2083},[],[82,2085,2086,157,2089],{},[75,2087,2088],{},"packagist",[16,2090,192],{"href":190,"rel":2091},[],[82,2093,2094,157,2096],{},[75,2095,197],{},[16,2097,202],{"href":200,"rel":2098},[],[82,2100,2101,157,2103],{},[75,2102,207],{},[16,2104,212],{"href":210,"rel":2105},[],[82,2107,2108,157,2110],{},[75,2109,217],{},[16,2111,222],{"href":220,"rel":2112},[],[82,2114,2115,157,2117,2120,2121,2124,2125,2127,2128,2130],{},[75,2116,227],{},[16,2118,231],{"href":180,"rel":2119},[],"\nThe example below illustrates how the ",[16,2122,54],{"href":52,"rel":2123},[],"' ",[75,2126,2043],{}," can be used to translate native version syntax to an intermediate representation.\nThe ",[75,2129,2043],{}," parses the native version syntax and translates it into a common format. In the example below, you can further see that both native, semantically equivalent but syntactically different version strings for packagist and maven are translated into a common format: a string array where a single array entry represents a conjunct of the semantic version constraints. This translation step removes all language-specific features from the native semantic version constraints.",[238,2132,2134],{"className":396,"code":2133,"language":398,"meta":243,"style":243},"# native packagist version constraint syntax\nvs_packagist = \"\u003C2.5.9||>=2.6.0,\u003C2.6.11\"\n# native maven version constraint syntax\nvs_maven = \"(,2.5.9),[2.6.0,2.6.11)\"\n\n# translate\nputs VersionTranslator.translate_packagist(vs_packagist).to_s\n# [\"\u003C2.5.9\", \">=2.6.0 \u003C2.6.11\"]\nputs VersionTranslator.translate_maven(vs_maven).to_s\n# [\"\u003C2.5.9\", \">=2.6.0 \u003C2.6.11\"]\n",[75,2135,2136,2141,2151,2156,2166,2170,2175,2193,2198,2214],{"__ignoreMap":243},[247,2137,2138],{"class":249,"line":250},[247,2139,2140],{"class":253},"# native packagist version constraint syntax\n",[247,2142,2143,2146,2148],{"class":249,"line":257},[247,2144,2145],{"class":405},"vs_packagist",[247,2147,410],{"class":409},[247,2149,2150],{"class":267}," \"\u003C2.5.9||>=2.6.0,\u003C2.6.11\"\n",[247,2152,2153],{"class":249,"line":271},[247,2154,2155],{"class":253},"# native maven version constraint syntax\n",[247,2157,2158,2161,2163],{"class":249,"line":280},[247,2159,2160],{"class":405},"vs_maven",[247,2162,410],{"class":409},[247,2164,2165],{"class":267}," \"(,2.5.9),[2.6.0,2.6.11)\"\n",[247,2167,2168],{"class":249,"line":289},[247,2169,1051],{"emptyLinePlaceholder":1050},[247,2171,2172],{"class":249,"line":297},[247,2173,2174],{"class":253},"# translate\n",[247,2176,2177,2179,2182,2184,2187,2190],{"class":249,"line":308},[247,2178,433],{"class":413},[247,2180,2181],{"class":413}," VersionTranslator",[247,2183,61],{"class":264},[247,2185,2186],{"class":460},"translate_packagist",[247,2188,2189],{"class":264},"(vs_packagist).",[247,2191,2192],{"class":460},"to_s\n",[247,2194,2195],{"class":249,"line":314},[247,2196,2197],{"class":253},"# [\"\u003C2.5.9\", \">=2.6.0 \u003C2.6.11\"]\n",[247,2199,2200,2202,2204,2206,2209,2212],{"class":249,"line":325},[247,2201,433],{"class":413},[247,2203,2181],{"class":413},[247,2205,61],{"class":264},[247,2207,2208],{"class":460},"translate_maven",[247,2210,2211],{"class":264},"(vs_maven).",[247,2213,2192],{"class":460},[247,2215,2216],{"class":249,"line":850},[247,2217,2197],{"class":253},[12,2219,2220,2221,94,2223,2225,2226,2229,2230,2232,2233,2235,2236,2238,2239,2242,2243,61],{},"This common format can then be translated to a version interval by means of ",[75,2222,717],{},[75,2224,1136],{},". The example below illustrates how the version interval ",[75,2227,2228],{},"constraint"," is generated by iterating over the array elements of our intermediate representation, translating them to intervals and adding these intervals to the ",[75,2231,1136],{}," object ",[75,2234,2228],{},". At the end of the excerpt below, we check whether version ",[75,2237,93],{}," satisfies the version constraint ",[75,2240,2241],{},"\u003C2.5.9||>=2.6.0,\u003C2.6.11"," which correctly yields ",[75,2244,2245],{},"true",[238,2247,2249],{"className":396,"code":2248,"language":398,"meta":243,"style":243},"# translate native maven version constraint to range of interval\nconstraint = VersionRange.new\nVersionTranslator.translate_maven(vs_maven).each do |version_string|\n  constraint \u003C\u003C VersionParser.parse(version_string)\nend\n\nputs constraint.overlaps_with?(VersionParser.parse('=' + '1.0.0'))\n# true\n",[75,2250,2251,2256,2268,2287,2304,2309,2313,2343],{"__ignoreMap":243},[247,2252,2253],{"class":249,"line":250},[247,2254,2255],{"class":253},"# translate native maven version constraint to range of interval\n",[247,2257,2258,2260,2262,2264,2266],{"class":249,"line":257},[247,2259,2228],{"class":405},[247,2261,410],{"class":409},[247,2263,1183],{"class":413},[247,2265,61],{"class":264},[247,2267,1188],{"class":409},[247,2269,2270,2272,2274,2276,2278,2281,2284],{"class":249,"line":271},[247,2271,2043],{"class":413},[247,2273,61],{"class":264},[247,2275,2208],{"class":460},[247,2277,2211],{"class":264},[247,2279,2280],{"class":460},"each",[247,2282,2283],{"class":409}," do",[247,2285,2286],{"class":264}," |version_string|\n",[247,2288,2289,2292,2295,2297,2299,2301],{"class":249,"line":280},[247,2290,2291],{"class":264},"  constraint ",[247,2293,2294],{"class":409},"\u003C\u003C",[247,2296,747],{"class":413},[247,2298,61],{"class":264},[247,2300,752],{"class":460},[247,2302,2303],{"class":264},"(version_string)\n",[247,2305,2306],{"class":249,"line":289},[247,2307,2308],{"class":409},"end\n",[247,2310,2311],{"class":249,"line":297},[247,2312,1051],{"emptyLinePlaceholder":1050},[247,2314,2315,2317,2320,2322,2324,2326,2328,2330,2332,2335,2338,2341],{"class":249,"line":308},[247,2316,433],{"class":413},[247,2318,2319],{"class":264}," constraint.",[247,2321,1255],{"class":460},[247,2323,422],{"class":264},[247,2325,717],{"class":413},[247,2327,61],{"class":264},[247,2329,752],{"class":460},[247,2331,422],{"class":264},[247,2333,2334],{"class":267},"'='",[247,2336,2337],{"class":409}," +",[247,2339,2340],{"class":267}," '1.0.0'",[247,2342,1040],{"class":264},[247,2344,2345],{"class":249,"line":314},[247,2346,2347],{"class":253},"# true\n",[63,2349,2351],{"id":2350},"wrapping-it-up","Wrapping it up",[12,2353,2354,2355,2358,2359,61],{},"We discussed the fragmentation of SemVer versioning which poses a challenge when building automation around semantic version processing for multi-language/ecosystem applications. In this blog post, we used our internal semi-automated process for advisory generation as an example.\nWe illustrated how we tackled the above-mentioned challenge by building a generic/language-agnostic semantic version approach based on linear interval arithmetic. All mechanisms discussed in this blog post are implemented in the open-sourced (MIT)\n",[16,2356,54],{"href":52,"rel":2357},[]," implementation and published on ",[16,2360,2362],{"href":58,"rel":2361},[],"rubygems.org",[2364,2365,2366],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sqxcx, html code.shiki .sqxcx{--shiki-default:#E36209}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}",{"title":243,"searchDepth":257,"depth":257,"links":2368},[2369,2370,2371,2376,2377],{"id":65,"depth":257,"text":66},{"id":389,"depth":257,"text":390},{"id":586,"depth":257,"text":587,"children":2372},[2373,2374,2375],{"id":943,"depth":271,"text":944},{"id":1318,"depth":271,"text":1319},{"id":1667,"depth":271,"text":1668},{"id":2032,"depth":257,"text":2033},{"id":2350,"depth":257,"text":2351},"security","2021-09-28","SemVer versioning made it difficult to automate processing. We turned to linear interval arithmetic to come up with a unified, language-agnostic semantic versioning approach.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749663397/Blog/Hero%20Images/logoforblogpost.jpg",{},"/en-us/blog/generic-semantic-version-processing",{"title":5,"description":2380,"ogTitle":5,"ogDescription":2380,"noIndex":2383,"ogImage":2384,"ogUrl":2388,"ogSiteName":2389,"ogType":2390,"canonicalUrls":2388},"https://about.gitlab.com/blog/generic-semantic-version-processing","https://about.gitlab.com","article","generic-semantic-version-processing","en-us/blog/generic-semantic-version-processing",[2378,2394,2395],"DevOps","open source","BlogPost","NYUzX7B6F1wRnevPpKBb-C0V8homQwnHypvojyMbDr4",{"logo":2399,"freeTrial":2404,"sales":2409,"login":2414,"items":2419,"search":2746,"minimal":2777,"duo":2796,"switchNav":2805,"pricingDeployment":2816},{"config":2400},{"href":2401,"dataGaName":2402,"dataGaLocation":2403},"/","gitlab logo","header",{"text":2405,"config":2406},"Get free trial",{"href":2407,"dataGaName":2408,"dataGaLocation":2403},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":2410,"config":2411},"Request a demo",{"href":2412,"dataGaName":2413,"dataGaLocation":2403},"/sales/?contact-topic=request-demo","sales",{"text":2415,"config":2416},"Sign in",{"href":2417,"dataGaName":2418,"dataGaLocation":2403},"https://gitlab.com/users/sign_in/","sign in",[2420,2449,2549,2554,2668,2724],{"text":2421,"config":2422,"menu":2424},"Platform",{"dataNavLevelOne":2423},"platform",{"type":2425,"columns":2426},"cards",[2427,2433,2441],{"title":2421,"description":2428,"link":2429},"The intelligent orchestration platform for DevSecOps",{"text":2430,"config":2431},"Explore our Platform",{"href":2432,"dataGaName":2423,"dataGaLocation":2403},"/platform/",{"title":2434,"description":2435,"link":2436},"GitLab Duo Agent Platform","Agentic AI for the entire software lifecycle",{"text":2437,"config":2438},"Meet GitLab Duo",{"href":2439,"dataGaName":2440,"dataGaLocation":2403},"/gitlab-duo-agent-platform/","gitlab duo agent platform",{"title":2442,"description":2443,"link":2444},"Why GitLab","See the top reasons enterprises choose GitLab",{"text":2445,"config":2446},"Learn more",{"href":2447,"dataGaName":2448,"dataGaLocation":2403},"/why-gitlab/","why gitlab",{"text":2450,"left":1050,"config":2451,"menu":2453},"Product",{"dataNavLevelOne":2452},"solutions",{"type":2454,"link":2455,"columns":2459,"feature":2528},"lists",{"text":2456,"config":2457},"View all Solutions",{"href":2458,"dataGaName":2452,"dataGaLocation":2403},"/solutions/",[2460,2484,2507],{"title":2461,"description":2462,"link":2463,"items":2468},"Automation","CI/CD and automation to accelerate deployment",{"config":2464},{"icon":2465,"href":2466,"dataGaName":2467,"dataGaLocation":2403},"AutomatedCodeAlt","/solutions/delivery-automation/","automated software delivery",[2469,2473,2476,2480],{"text":2470,"config":2471},"CI/CD",{"href":2472,"dataGaLocation":2403,"dataGaName":2470},"/solutions/continuous-integration/",{"text":2434,"config":2474},{"href":2439,"dataGaLocation":2403,"dataGaName":2475},"gitlab duo agent platform - product menu",{"text":2477,"config":2478},"Source Code Management",{"href":2479,"dataGaLocation":2403,"dataGaName":2477},"/solutions/source-code-management/",{"text":2481,"config":2482},"Automated Software Delivery",{"href":2466,"dataGaLocation":2403,"dataGaName":2483},"Automated software delivery",{"title":2485,"description":2486,"link":2487,"items":2492},"Security","Deliver code faster without compromising security",{"config":2488},{"href":2489,"dataGaName":2490,"dataGaLocation":2403,"icon":2491},"/solutions/application-security-testing/","security and compliance","ShieldCheckLight",[2493,2497,2502],{"text":2494,"config":2495},"Application Security Testing",{"href":2489,"dataGaName":2496,"dataGaLocation":2403},"Application security testing",{"text":2498,"config":2499},"Software Supply Chain Security",{"href":2500,"dataGaLocation":2403,"dataGaName":2501},"/solutions/supply-chain/","Software supply chain security",{"text":2503,"config":2504},"Software Compliance",{"href":2505,"dataGaName":2506,"dataGaLocation":2403},"/solutions/software-compliance/","software compliance",{"title":2508,"link":2509,"items":2514},"Measurement",{"config":2510},{"icon":2511,"href":2512,"dataGaName":2513,"dataGaLocation":2403},"DigitalTransformation","/solutions/visibility-measurement/","visibility and measurement",[2515,2519,2523],{"text":2516,"config":2517},"Visibility & Measurement",{"href":2512,"dataGaLocation":2403,"dataGaName":2518},"Visibility and Measurement",{"text":2520,"config":2521},"Value Stream Management",{"href":2522,"dataGaLocation":2403,"dataGaName":2520},"/solutions/value-stream-management/",{"text":2524,"config":2525},"Analytics & Insights",{"href":2526,"dataGaLocation":2403,"dataGaName":2527},"/solutions/analytics-and-insights/","Analytics and insights",{"title":2529,"type":2454,"items":2530},"GitLab for",[2531,2537,2543],{"text":2532,"config":2533},"Enterprise",{"icon":2534,"href":2535,"dataGaLocation":2403,"dataGaName":2536},"Building","/enterprise/","enterprise",{"text":2538,"config":2539},"Small Business",{"icon":2540,"href":2541,"dataGaLocation":2403,"dataGaName":2542},"Work","/small-business/","small business",{"text":2544,"config":2545},"Public Sector",{"icon":2546,"href":2547,"dataGaLocation":2403,"dataGaName":2548},"Organization","/solutions/public-sector/","public sector",{"text":2550,"config":2551},"Pricing",{"href":2552,"dataGaName":2553,"dataGaLocation":2403,"dataNavLevelOne":2553},"/pricing/","pricing",{"text":2555,"config":2556,"menu":2558},"Resources",{"dataNavLevelOne":2557},"resources",{"type":2454,"link":2559,"columns":2563,"feature":2657},{"text":2560,"config":2561},"View all resources",{"href":2562,"dataGaName":2557,"dataGaLocation":2403},"/resources/",[2564,2597,2624],{"title":2565,"items":2566},"Getting started",[2567,2572,2577,2582,2587,2592],{"text":2568,"config":2569},"Install",{"href":2570,"dataGaName":2571,"dataGaLocation":2403},"/install/","install",{"text":2573,"config":2574},"Quick start guides",{"href":2575,"dataGaName":2576,"dataGaLocation":2403},"/get-started/","quick setup checklists",{"text":2578,"config":2579},"Learn",{"href":2580,"dataGaLocation":2403,"dataGaName":2581},"https://university.gitlab.com/","learn",{"text":2583,"config":2584},"Product documentation",{"href":2585,"dataGaName":2586,"dataGaLocation":2403},"https://docs.gitlab.com/","product documentation",{"text":2588,"config":2589},"Best practice videos",{"href":2590,"dataGaName":2591,"dataGaLocation":2403},"/getting-started-videos/","best practice videos",{"text":2593,"config":2594},"Integrations",{"href":2595,"dataGaName":2596,"dataGaLocation":2403},"/integrations/","integrations",{"title":2598,"items":2599},"Discover",[2600,2605,2610,2615,2619],{"text":2601,"config":2602},"Customer success stories",{"href":2603,"dataGaName":2604,"dataGaLocation":2403},"/customers/","customer success stories",{"text":2606,"config":2607},"Blog",{"href":2608,"dataGaName":2609,"dataGaLocation":2403},"/blog/","blog",{"text":2611,"config":2612},"Demo Hub",{"href":2613,"dataGaName":2614,"dataGaLocation":2403},"/demo-hub/","demo hub",{"text":2616,"config":2617},"The Source",{"href":2618,"dataGaName":2609,"dataGaLocation":2403},"/the-source/",{"text":2620,"config":2621},"Remote",{"href":2622,"dataGaName":2623,"dataGaLocation":2403},"https://handbook.gitlab.com/handbook/company/culture/all-remote/","remote",{"title":2625,"items":2626},"Connect",[2627,2632,2637,2642,2647,2652],{"text":2628,"config":2629},"GitLab Services",{"href":2630,"dataGaName":2631,"dataGaLocation":2403},"/services/","services",{"text":2633,"config":2634},"Contribute",{"href":2635,"dataGaName":2636,"dataGaLocation":2403},"https://contributors.gitlab.com","contribute",{"text":2638,"config":2639},"Community",{"href":2640,"dataGaName":2641,"dataGaLocation":2403},"/community/","community",{"text":2643,"config":2644},"Forum",{"href":2645,"dataGaName":2646,"dataGaLocation":2403},"https://forum.gitlab.com/","forum",{"text":2648,"config":2649},"Events",{"href":2650,"dataGaName":2651,"dataGaLocation":2403},"/events/","events",{"text":2653,"config":2654},"Partners",{"href":2655,"dataGaName":2656,"dataGaLocation":2403},"/partners/","partners",{"config":2658,"title":2661,"text":2662,"link":2663},{"background":2659,"textColor":2660},"url('https://res.cloudinary.com/about-gitlab-com/image/upload/v1777322348/qpq8yrgn8knii57omj0c.png')","#000","What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":2664,"config":2665},"Read the latest",{"href":2666,"dataGaName":2667,"dataGaLocation":2403},"/whats-new/","whats new",{"text":2669,"config":2670,"menu":2672},"Company",{"dataNavLevelOne":2671},"company",{"type":2454,"columns":2673},[2674],{"items":2675},[2676,2681,2687,2689,2694,2699,2704,2709,2714,2719],{"text":2677,"config":2678},"About",{"href":2679,"dataGaName":2680,"dataGaLocation":2403},"/company/","about",{"text":2682,"config":2683,"footerGa":2686},"Jobs",{"href":2684,"dataGaName":2685,"dataGaLocation":2403},"/jobs/","jobs",{"dataGaName":2685},{"text":2648,"config":2688},{"href":2650,"dataGaName":2651,"dataGaLocation":2403},{"text":2690,"config":2691},"Leadership",{"href":2692,"dataGaName":2693,"dataGaLocation":2403},"/company/team/e-group/","leadership",{"text":2695,"config":2696},"Handbook",{"href":2697,"dataGaName":2698,"dataGaLocation":2403},"https://handbook.gitlab.com/","handbook",{"text":2700,"config":2701},"Investor relations",{"href":2702,"dataGaName":2703,"dataGaLocation":2403},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":2705,"config":2706},"Trust Center",{"href":2707,"dataGaName":2708,"dataGaLocation":2403},"/security/","trust center",{"text":2710,"config":2711},"AI Transparency Center",{"href":2712,"dataGaName":2713,"dataGaLocation":2403},"/ai-transparency-center/","ai transparency center",{"text":2715,"config":2716},"Newsletter",{"href":2717,"dataGaName":2718,"dataGaLocation":2403},"/company/contact/#contact-forms","newsletter",{"text":2720,"config":2721},"Press",{"href":2722,"dataGaName":2723,"dataGaLocation":2403},"/press/","press",{"text":2725,"config":2726,"menu":2727},"Contact us",{"dataNavLevelOne":2671},{"type":2454,"columns":2728},[2729],{"items":2730},[2731,2736,2741],{"text":2732,"config":2733},"Talk to sales",{"href":2734,"dataGaName":2735,"dataGaLocation":2403},"/sales/","talk to sales",{"text":2737,"config":2738},"Support portal",{"href":2739,"dataGaName":2740,"dataGaLocation":2403},"https://support.gitlab.com/hc/en-us","support portal",{"text":2742,"config":2743},"Customer portal",{"href":2744,"dataGaName":2745,"dataGaLocation":2403},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":2747,"login":2748,"suggestions":2755},"Close",{"text":2749,"link":2750},"To search repositories and projects, login to",{"text":2751,"config":2752},"gitlab.com",{"href":2417,"dataGaName":2753,"dataGaLocation":2754},"search login","search",{"text":2756,"default":2757},"Suggestions",[2758,2760,2764,2766,2770,2774],{"text":2434,"config":2759},{"href":2439,"dataGaName":2434,"dataGaLocation":2754},{"text":2761,"config":2762},"Code Suggestions (AI)",{"href":2763,"dataGaName":2761,"dataGaLocation":2754},"/solutions/code-suggestions/",{"text":2470,"config":2765},{"href":2472,"dataGaName":2470,"dataGaLocation":2754},{"text":2767,"config":2768},"GitLab on AWS",{"href":2769,"dataGaName":2767,"dataGaLocation":2754},"/partners/technology-partners/aws/",{"text":2771,"config":2772},"GitLab on Google Cloud",{"href":2773,"dataGaName":2771,"dataGaLocation":2754},"/partners/technology-partners/google-cloud-platform/",{"text":2775,"config":2776},"Why GitLab?",{"href":2447,"dataGaName":2775,"dataGaLocation":2754},{"freeTrial":2778,"mobileIcon":2783,"desktopIcon":2788,"secondaryButton":2791},{"text":2779,"config":2780},"Start free trial",{"href":2781,"dataGaName":2408,"dataGaLocation":2782},"https://gitlab.com/-/trials/new/","nav",{"altText":2784,"config":2785},"Gitlab Icon",{"src":2786,"dataGaName":2787,"dataGaLocation":2782},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":2784,"config":2789},{"src":2790,"dataGaName":2787,"dataGaLocation":2782},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":2792,"config":2793},"Get Started",{"href":2794,"dataGaName":2795,"dataGaLocation":2782},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":2797,"mobileIcon":2801,"desktopIcon":2803},{"text":2798,"config":2799},"Learn more about GitLab Duo",{"href":2439,"dataGaName":2800,"dataGaLocation":2782},"gitlab duo",{"altText":2784,"config":2802},{"src":2786,"dataGaName":2787,"dataGaLocation":2782},{"altText":2784,"config":2804},{"src":2790,"dataGaName":2787,"dataGaLocation":2782},{"button":2806,"mobileIcon":2811,"desktopIcon":2813},{"text":2807,"config":2808},"/switch",{"href":2809,"dataGaName":2810,"dataGaLocation":2782},"#contact","switch",{"altText":2784,"config":2812},{"src":2786,"dataGaName":2787,"dataGaLocation":2782},{"altText":2784,"config":2814},{"src":2815,"dataGaName":2787,"dataGaLocation":2782},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":2817,"mobileIcon":2822,"desktopIcon":2824},{"text":2818,"config":2819},"Back to pricing",{"href":2552,"dataGaName":2820,"dataGaLocation":2782,"icon":2821},"back to pricing","GoBack",{"altText":2784,"config":2823},{"src":2786,"dataGaName":2787,"dataGaLocation":2782},{"altText":2784,"config":2825},{"src":2790,"dataGaName":2787,"dataGaLocation":2782},{"title":2827,"titleMobile":2828,"button":2829,"config":2834},"Duo Agent Platform delivers 400% ROI, per new Forrester Consulting study.","400% ROI: Forrester TEI for GitLab Duo",{"text":2445,"config":2830},{"href":2831,"dataGaName":2832,"dataGaLocation":2833},"https://about.gitlab.com/blog/gitlab-duo-agent-platform-delivers-400-percent-roi/","forrester-tei-dap-banner","global-banner",{"layout":2835,"disabled":2383},"release",{"data":2837},{"text":2838,"source":2839,"edit":2845,"contribute":2850,"config":2855,"items":2860,"minimal":3069},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"text":2840,"config":2841},"View page source",{"href":2842,"dataGaName":2843,"dataGaLocation":2844},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/","page source","footer",{"text":2846,"config":2847},"Edit this page",{"href":2848,"dataGaName":2849,"dataGaLocation":2844},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/content/","web ide",{"text":2851,"config":2852},"Please contribute",{"href":2853,"dataGaName":2854,"dataGaLocation":2844},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/CONTRIBUTING.md/","please contribute",{"twitter":2856,"facebook":2857,"youtube":2858,"linkedin":2859},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[2861,2908,2961,3005,3037],{"title":2550,"links":2862,"subMenu":2877},[2863,2867,2872],{"text":2864,"config":2865},"View plans",{"href":2552,"dataGaName":2866,"dataGaLocation":2844},"view plans",{"text":2868,"config":2869},"Why Premium?",{"href":2870,"dataGaName":2871,"dataGaLocation":2844},"/pricing/premium/","why premium",{"text":2873,"config":2874},"Why Ultimate?",{"href":2875,"dataGaName":2876,"dataGaLocation":2844},"/pricing/ultimate/","why ultimate",[2878],{"title":2879,"links":2880},"Contact Us",[2881,2884,2886,2888,2893,2898,2903],{"text":2882,"config":2883},"Contact sales",{"href":2734,"dataGaName":2413,"dataGaLocation":2844},{"text":2737,"config":2885},{"href":2739,"dataGaName":2740,"dataGaLocation":2844},{"text":2742,"config":2887},{"href":2744,"dataGaName":2745,"dataGaLocation":2844},{"text":2889,"config":2890},"Status",{"href":2891,"dataGaName":2892,"dataGaLocation":2844},"https://status.gitlab.com/","status",{"text":2894,"config":2895},"Terms of use",{"href":2896,"dataGaName":2897,"dataGaLocation":2844},"/terms/","terms of use",{"text":2899,"config":2900},"Privacy statement",{"href":2901,"dataGaName":2902,"dataGaLocation":2844},"/privacy/","privacy statement",{"text":2904,"config":2905},"Cookie preferences",{"dataGaName":2906,"dataGaLocation":2844,"id":2907,"isOneTrustButton":1050},"cookie preferences","ot-sdk-btn",{"title":2450,"links":2909,"subMenu":2918},[2910,2914],{"text":2911,"config":2912},"DevSecOps platform",{"href":2432,"dataGaName":2913,"dataGaLocation":2844},"devsecops platform",{"text":2915,"config":2916},"AI-Assisted Development",{"href":2439,"dataGaName":2917,"dataGaLocation":2844},"ai-assisted development",[2919],{"title":2920,"links":2921},"Topics",[2922,2927,2932,2936,2941,2946,2951,2956],{"text":2923,"config":2924},"CICD",{"href":2925,"dataGaName":2926,"dataGaLocation":2844},"/topics/ci-cd/","cicd",{"text":2928,"config":2929},"GitOps",{"href":2930,"dataGaName":2931,"dataGaLocation":2844},"/topics/gitops/","gitops",{"text":2394,"config":2933},{"href":2934,"dataGaName":2935,"dataGaLocation":2844},"/topics/devops/","devops",{"text":2937,"config":2938},"Version Control",{"href":2939,"dataGaName":2940,"dataGaLocation":2844},"/topics/version-control/","version control",{"text":2942,"config":2943},"DevSecOps",{"href":2944,"dataGaName":2945,"dataGaLocation":2844},"/topics/devsecops/","devsecops",{"text":2947,"config":2948},"Cloud Native",{"href":2949,"dataGaName":2950,"dataGaLocation":2844},"/topics/cloud-native/","cloud native",{"text":2952,"config":2953},"AI for Coding",{"href":2954,"dataGaName":2955,"dataGaLocation":2844},"/topics/devops/ai-for-coding/","ai for coding",{"text":2957,"config":2958},"Agentic AI",{"href":2959,"dataGaName":2960,"dataGaLocation":2844},"/topics/agentic-ai/","agentic ai",{"title":2962,"links":2963},"Solutions",[2964,2966,2968,2973,2977,2980,2984,2987,2989,2992,2995,3000],{"text":2494,"config":2965},{"href":2489,"dataGaName":2494,"dataGaLocation":2844},{"text":2483,"config":2967},{"href":2466,"dataGaName":2467,"dataGaLocation":2844},{"text":2969,"config":2970},"Agile development",{"href":2971,"dataGaName":2972,"dataGaLocation":2844},"/solutions/agile-delivery/","agile delivery",{"text":2974,"config":2975},"SCM",{"href":2479,"dataGaName":2976,"dataGaLocation":2844},"source code management",{"text":2923,"config":2978},{"href":2472,"dataGaName":2979,"dataGaLocation":2844},"continuous integration & delivery",{"text":2981,"config":2982},"Value stream management",{"href":2522,"dataGaName":2983,"dataGaLocation":2844},"value stream management",{"text":2928,"config":2985},{"href":2986,"dataGaName":2931,"dataGaLocation":2844},"/solutions/gitops/",{"text":2532,"config":2988},{"href":2535,"dataGaName":2536,"dataGaLocation":2844},{"text":2990,"config":2991},"Small business",{"href":2541,"dataGaName":2542,"dataGaLocation":2844},{"text":2993,"config":2994},"Public sector",{"href":2547,"dataGaName":2548,"dataGaLocation":2844},{"text":2996,"config":2997},"Education",{"href":2998,"dataGaName":2999,"dataGaLocation":2844},"/solutions/education/","education",{"text":3001,"config":3002},"Financial services",{"href":3003,"dataGaName":3004,"dataGaLocation":2844},"/solutions/finance/","financial services",{"title":2555,"links":3006},[3007,3009,3011,3013,3016,3018,3021,3023,3025,3027,3029,3031,3033,3035],{"text":2568,"config":3008},{"href":2570,"dataGaName":2571,"dataGaLocation":2844},{"text":2573,"config":3010},{"href":2575,"dataGaName":2576,"dataGaLocation":2844},{"text":2578,"config":3012},{"href":2580,"dataGaName":2581,"dataGaLocation":2844},{"text":2583,"config":3014},{"href":2585,"dataGaName":3015,"dataGaLocation":2844},"docs",{"text":2606,"config":3017},{"href":2608,"dataGaName":2609,"dataGaLocation":2844},{"text":3019,"config":3020},"What's new",{"href":2666,"dataGaName":2667,"dataGaLocation":2844},{"text":2601,"config":3022},{"href":2603,"dataGaName":2604,"dataGaLocation":2844},{"text":2620,"config":3024},{"href":2622,"dataGaName":2623,"dataGaLocation":2844},{"text":2628,"config":3026},{"href":2630,"dataGaName":2631,"dataGaLocation":2844},{"text":2633,"config":3028},{"href":2635,"dataGaName":2636,"dataGaLocation":2844},{"text":2638,"config":3030},{"href":2640,"dataGaName":2641,"dataGaLocation":2844},{"text":2643,"config":3032},{"href":2645,"dataGaName":2646,"dataGaLocation":2844},{"text":2648,"config":3034},{"href":2650,"dataGaName":2651,"dataGaLocation":2844},{"text":2653,"config":3036},{"href":2655,"dataGaName":2656,"dataGaLocation":2844},{"title":2669,"links":3038},[3039,3041,3043,3045,3047,3049,3053,3058,3060,3062,3064],{"text":2677,"config":3040},{"href":2679,"dataGaName":2671,"dataGaLocation":2844},{"text":2682,"config":3042},{"href":2684,"dataGaName":2685,"dataGaLocation":2844},{"text":2690,"config":3044},{"href":2692,"dataGaName":2693,"dataGaLocation":2844},{"text":2695,"config":3046},{"href":2697,"dataGaName":2698,"dataGaLocation":2844},{"text":2700,"config":3048},{"href":2702,"dataGaName":2703,"dataGaLocation":2844},{"text":3050,"config":3051},"Sustainability",{"href":3052,"dataGaName":3050,"dataGaLocation":2844},"/sustainability/",{"text":3054,"config":3055},"Diversity, inclusion and belonging (DIB)",{"href":3056,"dataGaName":3057,"dataGaLocation":2844},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":2705,"config":3059},{"href":2707,"dataGaName":2708,"dataGaLocation":2844},{"text":2715,"config":3061},{"href":2717,"dataGaName":2718,"dataGaLocation":2844},{"text":2720,"config":3063},{"href":2722,"dataGaName":2723,"dataGaLocation":2844},{"text":3065,"config":3066},"Modern Slavery Transparency Statement",{"href":3067,"dataGaName":3068,"dataGaLocation":2844},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":3070},[3071,3074,3077],{"text":3072,"config":3073},"Terms",{"href":2896,"dataGaName":2897,"dataGaLocation":2844},{"text":3075,"config":3076},"Cookies",{"dataGaName":2906,"dataGaLocation":2844,"id":2907,"isOneTrustButton":1050},{"text":3078,"config":3079},"Privacy",{"href":2901,"dataGaName":2902,"dataGaLocation":2844},[3081],{"id":3082,"title":7,"body":2382,"config":3083,"content":3085,"description":2382,"extension":3088,"meta":3089,"navigation":1050,"path":3090,"seo":3091,"stem":3092,"__hash__":3093},"blogAuthors/en-us/blog/authors/julian-thome.yml",{"template":3084},"BlogAuthor",{"name":7,"config":3086},{"headshot":243,"ctfId":3087},"jthome","yml",{},"/en-us/blog/authors/julian-thome",{},"en-us/blog/authors/julian-thome","60j2yTW0PuY7q83cXf4NkfzrKTRE2sUlVv5TXE6o1xM",[3095,3102,3110],{"title":3096,"description":3097,"heroImage":3098,"category":2378,"date":3099,"authors":3100,"slug":3101,"externalUrl":2382},"How GitLab tracks vulnerabilities through refactors and reformatting","Learn how GitLab's improved Scope+Offset fingerprinting keeps vulnerability tracking stable across comments, blank lines, and reformatting.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1759320418/xjmqcozxzt4frx0hori3.png","2026-08-12",[7],"improved-scope-offset-fingerprinting",{"title":3103,"description":3104,"heroImage":3098,"category":2378,"date":3105,"authors":3106,"slug":3109,"externalUrl":2382},"GitLab Secrets Manager adds ESO, Terraform, API support","Simplify credential management across your stack. GitLab Secrets Manager provides secure retrieval in Kubernetes, Terraform, and external workflows.","2026-08-06",[3107,3108],"Erick Bajao","Joe Randazzo","gitlab-secrets-manager-add-eso-terraform-api-support",{"title":3111,"description":3112,"heroImage":3113,"category":2378,"date":3114,"authors":3115,"slug":3117,"externalUrl":2382},"Secure every commit to production with Claude and GitLab","Claude Security catches vulnerabilities inside a coding session. GitLab picks up from there, scanning, enforcing policy, and producing audit evidence for the software lifecycle. ","https://res.cloudinary.com/about-gitlab-com/image/upload/v1756122536/akivvcnafog9c4dhhzkp.png","2026-08-03",[3116],"Alisa Ho","claude-security-and-gitlab",{"promotions":3119},[3120,3134,3146,3157],{"id":3121,"categories":3122,"header":3124,"text":3125,"button":3126,"image":3131},"ai-modernization",[3123],"ai","Is AI achieving its promise at scale?","Quiz will take 5 minutes or less",{"text":3127,"config":3128},"Get your AI maturity score",{"href":3129,"dataGaName":3130,"dataGaLocation":2609},"/assessments/ai-modernization-assessment/","modernization assessment",{"config":3132},{"src":3133},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/qix0m7kwnd8x2fh1zq49.png",{"id":3135,"categories":3136,"header":3138,"text":3125,"button":3139,"image":3143},"devops-modernization",[3137,2945],"product","Are you just managing tools or shipping innovation?",{"text":3140,"config":3141},"Get your DevOps maturity score",{"href":3142,"dataGaName":3130,"dataGaLocation":2609},"/assessments/devops-modernization-assessment/",{"config":3144},{"src":3145},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138785/eg818fmakweyuznttgid.png",{"id":3147,"categories":3148,"header":3149,"text":3125,"button":3150,"image":3154},"security-modernization",[2378],"Are you trading speed for security?",{"text":3151,"config":3152},"Get your security maturity score",{"href":3153,"dataGaName":3130,"dataGaLocation":2609},"/assessments/security-modernization-assessment/",{"config":3155},{"src":3156},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/p4pbqd9nnjejg5ds6mdk.png",{"id":3158,"paths":3159,"header":3162,"text":3163,"button":3164,"image":3169},"github-azure-migration",[3160,3161],"migration-from-azure-devops-to-gitlab","integrating-azure-devops-scm-and-gitlab","Is your team ready for GitHub's Azure move?","GitHub is already rebuilding around Azure. Find out what it means for you.",{"text":3165,"config":3166},"See how GitLab compares to GitHub",{"href":3167,"dataGaName":3168,"dataGaLocation":2609},"/compare/gitlab-vs-github/github-azure-migration/","github azure migration",{"config":3170},{"src":3145},{"header":3172,"blurb":3173,"button":3174,"secondaryButton":3179},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":3175,"config":3176},"Get your free trial",{"href":3177,"dataGaName":2408,"dataGaLocation":3178},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":2882,"config":3180},{"href":2734,"dataGaName":2413,"dataGaLocation":3178},1786803749605]