-
Notifications
You must be signed in to change notification settings - Fork 1.1k
@
character is no longer supported in SMB domain, username or password
#9794
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
Milestone
Comments
smitsjelle
added a commit
to smitsjelle/spring-integration
that referenced
this issue
Jan 28, 2025
…d password Fixes: spring-projects#9794 The `SmbConfig.rawUrl()` method doesn't apply any URL encoding, resulting in parts of the `domainUserPass` that may contain a `@` character to break the URL logic in regard to determining the hostname. * Modify `SmbConfig.getDomainUserPass(_includePassword)` to conditionally encode the variables. Makes sure to encode the individual parts to not undesirably encode the `;` and `:` characters, breaking other logic. * Modify `SmbConfig.rawUrl(_includePassword)` and `SmbConfig.createUri(_includePassword)` to call the modified method with the correct `_urlEncode` variable Signed-off-by: Jelle Smits <[email protected]>
artembilan
pushed a commit
that referenced
this issue
Jan 28, 2025
Fixes: #9794 Issue link: #9794 The `SmbConfig.rawUrl()` method doesn't apply any URL encoding, resulting in parts of the `domainUserPass` that may contain a `@` character to break the URL logic in regard to determining the hostname. * Modify `SmbConfig.getDomainUserPass(_includePassword)` to conditionally encode the variables. Makes sure to encode the individual parts to not undesirably encode the `;` and `:` characters, breaking other logic. * Modify `SmbConfig.rawUrl(_includePassword)` and `SmbConfig.createUri(_includePassword)` to call the modified method with the correct `_urlEncode` variable Signed-off-by: Jelle Smits <[email protected]> [[email protected]: some code cleanup] * Add author to the affected classes * Remove redundant explicit exceptions list from the `SmbMessageHistoryTests` **Auto-cherry-pick to `6.3.x`** Signed-off-by: Artem Bilan <[email protected]>
spring-builds
pushed a commit
that referenced
this issue
Jan 28, 2025
Fixes: #9794 Issue link: #9794 The `SmbConfig.rawUrl()` method doesn't apply any URL encoding, resulting in parts of the `domainUserPass` that may contain a `@` character to break the URL logic in regard to determining the hostname. * Modify `SmbConfig.getDomainUserPass(_includePassword)` to conditionally encode the variables. Makes sure to encode the individual parts to not undesirably encode the `;` and `:` characters, breaking other logic. * Modify `SmbConfig.rawUrl(_includePassword)` and `SmbConfig.createUri(_includePassword)` to call the modified method with the correct `_urlEncode` variable Signed-off-by: Jelle Smits <[email protected]> [[email protected]: some code cleanup] * Add author to the affected classes * Remove redundant explicit exceptions list from the `SmbMessageHistoryTests` Signed-off-by: Artem Bilan <[email protected]> (cherry picked from commit fcd90a9)
This was referenced Jan 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In what version(s) of Spring Integration are you seeing this issue?
6.4.1
Describe the bug
With the introduction of the fix of GH-9711 that uses the new
rawUrl
method (thanks for the solution there by the way), I noticed that some existing connections suddenly were unauthorized. On investigation, it appeared that the common denominator is that in the cases of the connection breaking, the password contained an@
character. With the way the underlying JCIFS library calls the URL constructor, it will trigger thejava.net.Url
code to look forindexOf('@')
. When the URL resulting from therawUrl
method would besmb://sambaguest:samb@[email protected]:445/smb share
,java.net.URL
will interpret the host part as empty string (see screencap below). This (obviously) subsequently yields aUnknownHostException
.To Reproduce
Add the following lines to the existing
SmbMessageHistoryTests#testMessageHistory
method, it will fail on the assertion:Expected behavior
The
@
character can be used in the domain, username or password as it could before the fix.The text was updated successfully, but these errors were encountered: