FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: fix missing error checks on ASN1_STRING_to_UTF8() by ndossche · Pull Request #65200 · nodejs/node · GitHub

/ node Public

crypto: fix missing error checks on ASN1_STRING_to_UTF8() - #65200

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ndossche:asn1_string-1
Aug 20, 2026
Merged

crypto: fix missing error checks on ASN1_STRING_to_UTF8()#65200
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ndossche:asn1_string-1

Conversation

Copy link
Copy Markdown
Contributor

This function returns a negative error code on error. When it does so, the value_str pointer will remain uninitialized and cause a crash later on when it is freed by OPENSSL_free(). Even if it wouldn't crash there, it still fails to signal the error and an empty string may be propagated to the callers. The check also mirrors the other one in the same file.

Note: this was found by a static-dynamic analyser I'm developing.

Supersedes nodejs/ncrypto#41

This function returns a negative error code on error.
When it does so, the `value_str` pointer will remain uninitialized
and cause a crash later on when it is freed by OPENSSL_free().
Even if it wouldn't crash there, it still fails to signal the error
and an empty string may be propagated to the callers.
The check also mirrors the other one in the same file.

Signed-off-by: ndossche <nora.dossche@ugent.be>

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg

nodejs-github-bot added dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run. labels Aug 10, 2026
panva added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 10, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 10, 2026

This comment was marked as outdated.

panva requested a review from tniessen August 10, 2026 21:41

This comment was marked as resolved.

Copy link
Copy Markdown
Collaborator

trivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 20, 2026
nodejs-github-bot merged commit 575abdf into nodejs:main Aug 20, 2026
83 checks passed

Copy link
Copy Markdown
Collaborator

Landed in 575abdf

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 20, 2026
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
This function returns a negative error code on error.
When it does so, the `value_str` pointer will remain uninitialized
and cause a crash later on when it is freed by OPENSSL_free().
Even if it wouldn't crash there, it still fails to signal the error
and an empty string may be propagated to the callers.
The check also mirrors the other one in the same file.

Signed-off-by: ndossche <nora.dossche@ugent.be>
PR-URL: #65200
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
This function returns a negative error code on error.
When it does so, the `value_str` pointer will remain uninitialized
and cause a crash later on when it is freed by OPENSSL_free().
Even if it wouldn't crash there, it still fails to signal the error
and an empty string may be propagated to the callers.
The check also mirrors the other one in the same file.

Signed-off-by: ndossche <nora.dossche@ugent.be>
PR-URL: #65200
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. dependencies Pull requests that update a dependency file. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL