Allow colon in socket path - #1305
Closed
magnusvin wants to merge 1 commit into
Closed
Conversation
Owner
|
This would parse |
magnusvin
force-pushed
the
allow-colon-in-socket-path
branch
from
July 20, 2026 14:44
dacb0e1 to
4ff6e67
Compare
Contributor
Author
|
Now is the change from Tested these values:
|
Owner
|
Thank you, I will fix it together with other problems this caused. |
vrana
added a commit
that referenced
this pull request
Jul 20, 2026
peterpp
added a commit
to adminneo-org/adminneo
that referenced
this pull request
Jul 20, 2026
Inspired by: vrana/adminer#1305 Thanks to @magnusvin
peterpp
pushed a commit
to adminneo-org/adminneo
that referenced
this pull request
Aug 5, 2026
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a regression introduced by 3faf095 (GHSA-58cq-mgw2-38m5) that made host_port() reject server strings where the socket/port portion contains a colon, causing a spurious "Invalid server." error. This breaks connecting via socket paths that legitimately contain colons, e.g.:
:/cloudsql/project:region:instance(Google Cloud SQL Unix socket):/var/www/mysql.sockChanges
adminer/include/auth.inc.php: allow:in the validated port/socket pattern([-\w./]*→[-\w.:/]*), matching whathost_port()can return.adminer/include/functions.inc.php:host_port()'s port/socket capture group changed from[^:].+to[^:].*. The.+required at least 2 characters after the colon, so a single-character port (e.g.localhost:5) failed to match and was returned unsplit as the host instead of being split into (host, port). Since the host pattern permits colons, this let a single-character port slip past the privileged-port check (<1024) entirely, as the port value it checks was left empty..*restores splitting for 1-character ports/sockets too.