Skip to content

fix Type confusion through parameter tampering #14204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

odaysec
Copy link
Contributor

@odaysec odaysec commented May 13, 2025

arr.push(buf.slice(start, start + chunk_size[i]));

fix the issue need to ensure that the buf parameter in the stripChunkSignature function is of the expected type (Buffer). If buf is not a Buffer, the function should either throw an error or return the input unchanged, depending on the desired behavior. This can be achieved by adding a runtime type check at the beginning of the function.

  1. Add a type check to verify that buf is a Buffer using Buffer.isBuffer(buf).
  2. If the check fails, return the input unchanged or handle the error appropriately.
  3. This change ensures that the function behaves predictably even if buf is tampered with.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@odaysec odaysec requested a review from a team as a code owner May 13, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant