Skip to content

fix: Unhandled ValueError during authentication#2118

Open
intelliking wants to merge 1 commit intofortra:masterfrom
intelliking:fix/issue-unhandled-value-error
Open

fix: Unhandled ValueError during authentication#2118
intelliking wants to merge 1 commit intofortra:masterfrom
intelliking:fix/issue-unhandled-value-error

Conversation

@intelliking
Copy link

Fixes #2099

Problem

When SMB authentication fails due to incomplete server responses (network drops, timeouts), users see:

ValueError: subsection not found

This error message doesn't indicate what failed or which field caused the issue.

Solution

Added exception handling to catch the ValueError and provide a clearer error message:

ValueError: Can't find NUL terminator in field 'NativeOS'

Changes

  • impacket/structure.py: Added try/except block for ASCII string parsing (3 lines)
  • Additionally modify UTF-16le error

@intelliking
Copy link
Author

Hi @anadrianmanrique. Could you please review my PR and share any feedback? thank you.

@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled ValueError during authentication

3 participants