Skip to content

gsasl: fix potential double free#21609

Closed
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:gsasl-double-free
Closed

gsasl: fix potential double free#21609
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:gsasl-double-free

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented May 14, 2026

Also:

Reported-by: Joshua Rogers (Aisle Research)

@vszakats
Copy link
Copy Markdown
Member Author

@aisle-analyzer

@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot Bot commented May 14, 2026

🔒 Aisle Security Analysis

✅ We scanned this PR and did not find any security vulnerabilities.
Aisle supplements but does not replace security review.


Analyzed PR: #21609 at commit 1f709aa

Last updated on: 2026-05-14T13:21:52Z

Copy link
Copy Markdown

Copilot AI left a 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 hardens the libgsasl SCRAM integration in lib/vauth/ by preventing a potential double-free during error cleanup, and aligns documented minimum dependency versions with the new requirement.

Changes:

  • Enforce libgsasl >= 1.6.0 at compile time to rely on gsasl_finish(NULL) being safe.
  • Prevent a potential double-free by NULLing gsasl->ctx after gsasl_done() on gsasl_client_start() failure.
  • Document the libgsasl minimum supported version in docs/INTERNALS.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/vauth/gsasl.c Adds a minimum libgsasl version guard and avoids double-free by clearing gsasl->ctx after teardown on error.
docs/INTERNALS.md Documents libgsasl 1.6.0 (2010-12-14) as the minimum supported version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vszakats vszakats closed this in 3da249e May 15, 2026
@vszakats vszakats deleted the gsasl-double-free branch May 15, 2026 09:55
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Also:
- require libgsasl 1.6.0+ (2010-12-14) for a `gsasl_finish()` that
  handles a NULL argument.
  Ref: https://gitlab.com/gsasl/gsasl/-/commit/b550032df8488a9ceaa3cfd4c634947d8f219717

Reported-by: Joshua Rogers (Aisle Research)

Closes curl#21609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants