Skip to content

[all] Security: fix overflows#5901

Merged
hugtalbot merged 9 commits intosofa-framework:masterfrom
fredroy:fix_vulnerabilities_overflows
Feb 6, 2026
Merged

[all] Security: fix overflows#5901
hugtalbot merged 9 commits intosofa-framework:masterfrom
fredroy:fix_vulnerabilities_overflows

Conversation

@fredroy
Copy link
Contributor

@fredroy fredroy commented Jan 29, 2026

Different overflows risk were not checked,
and one array access is a bug (in BaseContactMapper)

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request pr: ai-generated Label notifying the reviewers that part or all of the PR has been generated with the help of an AI labels Jan 29, 2026
@fredroy fredroy force-pushed the fix_vulnerabilities_overflows branch from cbcd999 to e942da9 Compare January 29, 2026 03:53
@fredroy
Copy link
Contributor Author

fredroy commented Jan 29, 2026

[ci-build][with-all-tests]

@fredroy fredroy force-pushed the fix_vulnerabilities_overflows branch 2 times, most recently from 6c9a8b2 to d79f4e4 Compare February 3, 2026 22:05
@hugtalbot hugtalbot changed the title [All] Security: fix overflows [all] Security: fix overflows Feb 5, 2026
@hugtalbot hugtalbot added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Feb 5, 2026
fredroy and others added 8 commits February 6, 2026 12:57
…reading and writing same buffer).

  Fixed:
  sscanf(buf, "%*127s %127s", matName);

  Breaking down the format:
  - %*127s - The * is the assignment suppression modifier. It means "read up to 127 chars but discard them (don't store)". This skips the first word (like "newmtl")
  - %127s - Read the second word (the material name), limited to 127 chars, store in matName

  So if buf contains "newmtl MyMaterial\n":
  - %*127s reads and discards "newmtl"
  - %127s reads "MyMaterial" into matName

  The 127 limit prevents buffer overflow since matName is 128 bytes (127 chars + null terminator).
… buffer overflows from size calculation wraparound
….cpp

Co-authored-by: Paul Baksic <30337881+bakpaul@users.noreply.github.com>
@fredroy fredroy force-pushed the fix_vulnerabilities_overflows branch from aa7d380 to 7dbfb50 Compare February 6, 2026 03:57
@hugtalbot hugtalbot merged commit 50cda36 into sofa-framework:master Feb 6, 2026
10 of 13 checks passed
@hugtalbot hugtalbot deleted the fix_vulnerabilities_overflows branch February 6, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: ai-generated Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants