Skip to content

BUG: Prevent integer overflow in potential vulnerable cloned functions#5351

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:mainfrom
npt-1707:fix
Aug 15, 2025
Merged

BUG: Prevent integer overflow in potential vulnerable cloned functions#5351
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:mainfrom
npt-1707:fix

Conversation

@npt-1707
Copy link
Copy Markdown
Contributor

Hi Development Team,

I identified a potential integer overflow in clone functions in Modules/ThirdParty/Expat/src/expat/xmlparse.c sourced from libexpat/libexpat. This issue, originally reported in CVE-2022-22822 to CVE-2022-22822, was resolved in the repository via this commit libexpat/libexpat@9f93e80.

This PR applies the corresponding patch to fix the vulnerability in this codebase.

Please review at your convenience. Thank you!

@github-actions github-actions bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances area:ThirdParty Issues affecting the ThirdParty module labels May 15, 2025
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for contributing a pull request! 🙏

Welcome to the ITK community! 🤗👋☀️

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜
More support and guidance on the contribution process can be found in our contributing guide. 📖

This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment
on it.

Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Why only this commit? Can you do a general update of ITK's bundled expat? Latest release is usually a good choice.

@hjmjohnson
Copy link
Copy Markdown
Member

@dzenanz updating all of expat is likely a large undertaking that will need core developer input to get the name mangling and other elements done correctly. There is no UpdateFromUpstream.sh for expat, and setting that infrastructure up is likely beyond what a community contributor can easily accomplish.

I recommend that we backport this identified bug fix, and then place the larger effort of updating the entire Expat library as an issue for an upcomming release of ITK.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Aug 14, 2025

Sure. Do you want to take over this PR? At the very least, commit message needs an update. Ideally point to commit in upstream that is being cherry-picked, or a list of commits that have been squashed. That should ease future updating of this third party library.

Sourced from libexpat/libexpat. This issue, originally reported in
CVE-2022-22822 to CVE-2022-22822, was resolved in the repository via
this commit libexpat/libexpat@9f93e80
@hjmjohnson hjmjohnson merged commit 38cca37 into InsightSoftwareConsortium:main Aug 15, 2025
15 checks passed
hjmjohnson added a commit that referenced this pull request Aug 19, 2025
Organized files to match upstream expat directory layout in preparation
for minimizing differences.

Instrument with comments to clearly identify where differences from
upstream are desired in the CMakeLists.txt configurations.

Followup from 38cca37 and requests
for updates in #5351.
hjmjohnson added a commit that referenced this pull request Aug 20, 2025
Organized files to match upstream expat directory layout in preparation
for minimizing differences.

Instrument with comments to clearly identify where differences from
upstream are desired in the CMakeLists.txt configurations.

Followup from 38cca37 and requests
for updates in #5351.
hjmjohnson added a commit to hjmjohnson/ITK that referenced this pull request Sep 5, 2025
Organized files to match upstream expat directory layout in preparation
for minimizing differences.

Instrument with comments to clearly identify where differences from
upstream are desired in the CMakeLists.txt configurations.

Followup from 38cca37 and requests
for updates in InsightSoftwareConsortium#5351.
@npt-1707
Copy link
Copy Markdown
Contributor Author

Thanks for merging my PR, @hjmjohnson!

Just wanted to let you know that I plan to report this as a CVE. Please let me know if you have any concern. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ThirdParty Issues affecting the ThirdParty module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants