-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add security warning to ArrayPool.Return documentation #12062
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
Conversation
Co-authored-by: jkotas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a critical security warning to the ArrayPool<T>.Return method documentation, alerting developers to the severe consequences of misusing the API.
- Adds an IMPORTANT callout documenting double-free and use-after-free vulnerabilities
- Includes links to CWE definitions (CWE-415 and CWE-416) for reference
- Warns about potential consequences: data corruption, data leaks, and denial of service
Co-authored-by: jkotas <[email protected]>
|
Tanner is correct in that CWE-415 / 416 are very C-oriented. If there is a security incident resulting from misuse of ArrayPool, the culprit is most likely to be CWE-672 (root cause) and CWE-488 (proximate cause). If you were going for technical accuracy, I'd choose these over 415 / 416. I imagine this doc is going for a friendly analogy more than technical accuracy. In that light, "double free" and "use after free" seem fine since they're well understood concepts and they adequately enough describe the general shape of the problem. |
Summary
Adds an IMPORTANT note to
ArrayPool<T>.Returndocumenting that returning the same array twice or using it after return causes high-severity security vulnerabilities.The note warns about:
Both can lead to data corruption, data leaks, and denial of service. Links to CWE definitions are included for reference.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.