Skip to content
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

az_json_writer_chunked_init( ) - Improper Input Validation (CWE-20) #2237

Open
ericwol-msft opened this issue Jun 16, 2022 · 2 comments
Open
Assignees
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library.

Comments

@ericwol-msft
Copy link
Contributor

Data from External Sources to Internal APIs of the SDK needs Sanitization and Validation.
• File : src\azure\core\az_json_writer.c
• API : az_json_writer_chunked_init( )
• Lines : 38 – 62
• Issue : Improper Input Validation is Missing for:

  • first_destination_buffer
  • user_context

• Caller Graph:
image

image

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jun 16, 2022
@RickWinter RickWinter added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Azure.Core labels Jun 20, 2022
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jun 20, 2022
@ahsonkhan
Copy link
Member

ahsonkhan commented Jun 27, 2022

The void* user_context is intended to be an opaque pass-through variable for the customer to provide state to the callback, which the SDK doesn't intend to modify or read/write to at all. I believe it can be null or any arbitrary value, so there's no possible validation we can do here. Let's add that as a comment for maintainability, and to avoid such false positive detection in the future.

We'd want to verify through code inspection (and possibly a unit test) that null works fine here, just to make sure.

cc @JeffreyRichter

That said, validation of the first_destination_buffer might be a good idea.

@ericwol-msft
Copy link
Contributor Author

Correct. I told them that. You can ignore that issue. The only issue is the first_destination_buffer span.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

4 participants