Skip to content

[Build] Upgrade xgrammar to get a security fix#36168

Merged
russellb merged 2 commits intovllm-project:mainfrom
russellb:xgrammar-0.1.32
Mar 15, 2026
Merged

[Build] Upgrade xgrammar to get a security fix#36168
russellb merged 2 commits intovllm-project:mainfrom
russellb:xgrammar-0.1.32

Conversation

@russellb
Copy link
Copy Markdown
Member

@russellb russellb commented Mar 5, 2026

xgrammar 0.1.32 includes a CVE fix:

GHSA-7rgv-gqhr-fxg3

While we're at it, don't pin to specific version of xgrammar. After
speaking to the primary maintainer, they feel it should be safe to not
pin to a specific version at this point. We still have a "< 1.0.0"
limit in place in case they want to do a major revision that may not
be backwards compatible.

Signed-off-by: Russell Bryant rbryant@redhat.com

@mergify mergify bot added the ci/build label Mar 5, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the xgrammar dependency to version 0.1.32 to address a security vulnerability. It also changes the version pinning from an exact version to a version range. My review focuses on the dependency versioning strategy. While the security fix is important, the new version range of >= 0.1.32, < 1.0.0 is too broad for a pre-1.0 library and could lead to future build breakages due to backward-incompatible changes in minor releases (e.g., 0.2.0). I have suggested a more restrictive version range to mitigate this risk while still allowing for patch updates.

Note: Security Review has been skipped due to the limited scope of the PR.

diskcache == 5.6.3
lark == 1.2.2
xgrammar == 0.1.29; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"
xgrammar >= 0.1.32, < 1.0.0; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While upgrading xgrammar to fix the security vulnerability is a good move, the version constraint < 1.0.0 is too permissive for a pre-1.0 library and introduces a risk of future build failures.

According to Semantic Versioning, versions below 1.0.0 can introduce breaking changes even in minor releases (e.g., from 0.1.x to 0.2.0). The current constraint allows such upgrades automatically, which could lead to unexpected build or runtime errors if xgrammar releases a backward-incompatible 0.2.0 version.

To ensure stability and prevent future breakages, it's safer to restrict the allowed versions to the same minor series. This allows for patch releases (which should contain bug and security fixes) while preventing potentially breaking minor releases.

A more robust constraint would be >= 0.1.32, < 0.2.0.

xgrammar >= 0.1.32, < 0.2.0; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was based on a conversation with @Ubospica

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes look good to me. XGrammar is planning a v0.2 release, but it is compatible with the prior API.

@russellb russellb added this to the v0.17.0 cherry picks milestone Mar 6, 2026
Copy link
Copy Markdown
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @russellb

@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 6, 2026
@njhill
Copy link
Copy Markdown
Member

njhill commented Mar 6, 2026

We should make sure we unblock relevant structured outputs tests before merging...

@russellb russellb force-pushed the xgrammar-0.1.32 branch 4 times, most recently from 5fbf867 to b6324d4 Compare March 12, 2026 02:30
@praateekmahajan
Copy link
Copy Markdown

Can we merge this now?

xgrammar 0.1.32 includes a CVE fix:

GHSA-7rgv-gqhr-fxg3

While we're at it, don't pin to specific version of xgrammar. After
speaking to the primary maintainer, they feel it should be safe to not
pin to a specific version at this point. We still have a "< 1.0.0"
limit in place in case they want to do a major revision that may not
be backwards compatible.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
@russellb
Copy link
Copy Markdown
Member Author

We should make sure we unblock relevant structured outputs tests before merging...

I see the main structured output tests running and passing in this CI run, so I'm not sure there's anything else that needs to be turned on.

Let me know if I'm missing something, though!

@russellb russellb enabled auto-merge (squash) March 13, 2026 18:43
@russellb russellb merged commit b3debb7 into vllm-project:main Mar 15, 2026
116 checks passed
@russellb russellb removed this from the v0.17.0 cherry picks milestone Mar 16, 2026
Lucaskabela pushed a commit to Lucaskabela/vllm that referenced this pull request Mar 17, 2026
Signed-off-by: Russell Bryant <rbryant@redhat.com>
wendyliu235 pushed a commit to wendyliu235/vllm-public that referenced this pull request Mar 18, 2026
Signed-off-by: Russell Bryant <rbryant@redhat.com>
fxdawnn pushed a commit to fxdawnn/vllm that referenced this pull request Mar 19, 2026
Signed-off-by: Russell Bryant <rbryant@redhat.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm that referenced this pull request Mar 27, 2026
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Monishver11 pushed a commit to Monishver11/vllm that referenced this pull request Mar 27, 2026
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Monishver Chandrasekaran <monishverchandrasekaran@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants