Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
82563c5f
Commit
82563c5f
authored
Jul 21, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20110 don't try to load client plugins with invalid names
reported by lixtelnis
parent
f90040fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
mysql-test/r/connect_debug.result
mysql-test/r/connect_debug.result
+5
-0
mysql-test/t/connect_debug.test
mysql-test/t/connect_debug.test
+11
-0
sql-common/client_plugin.c
sql-common/client_plugin.c
+7
-1
sql/sql_acl.cc
sql/sql_acl.cc
+1
-0
No files found.
mysql-test/r/connect_debug.result
View file @
82563c5f
...
...
@@ -3,3 +3,8 @@ set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
set global debug_dbug=@old_dbug;
drop user bad;
set global debug_dbug='+d,auth_invalid_plugin';
create user 'bad' identified by 'worse';
ERROR 2059 (HY000): Authentication plugin 'foo/bar' cannot be loaded: invalid plugin name
set global debug_dbug=@old_dbug;
drop user bad;
mysql-test/t/connect_debug.test
View file @
82563c5f
source
include
/
not_embedded
.
inc
;
source
include
/
have_debug
.
inc
;
set
@
old_dbug
=@@
global
.
debug_dbug
;
...
...
@@ -10,3 +11,13 @@ create user 'bad' identified by 'worse';
--
exec
$MYSQL
--
default
-
auth
=
mysql_old_password
--
user
=
bad
--
password
=
worse
set
global
debug_dbug
=@
old_dbug
;
drop
user
bad
;
#
# malicious server, invalid plugin name
#
set
global
debug_dbug
=
'+d,auth_invalid_plugin'
;
create
user
'bad'
identified
by
'worse'
;
--
error
1
--
exec
$MYSQL
--
default
-
auth
=
mysql_old_password
--
user
=
bad
--
password
=
worse
2
>&
1
set
global
debug_dbug
=@
old_dbug
;
drop
user
bad
;
sql-common/client_plugin.c
View file @
82563c5f
...
...
@@ -362,7 +362,13 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
mysql
->
options
.
extension
&&
mysql
->
options
.
extension
->
plugin_dir
?
mysql
->
options
.
extension
->
plugin_dir
:
PLUGINDIR
,
"/"
,
name
,
SO_EXT
,
NullS
);
if
(
strpbrk
(
name
,
"()[]!@#$%^&/*;.,'?"
))
{
errmsg
=
"invalid plugin name"
;
goto
err
;
}
DBUG_PRINT
(
"info"
,
(
"dlopeninig %s"
,
dlpath
));
/* Open new dll handle */
if
(
!
(
dlhandle
=
dlopen
(
dlpath
,
RTLD_NOW
)))
...
...
sql/sql_acl.cc
View file @
82563c5f
...
...
@@ -8256,6 +8256,7 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
((
st_mysql_auth
*
)
(
plugin_decl
(
mpvio
->
plugin
)
->
info
))
->
client_auth_plugin
;
DBUG_EXECUTE_IF
(
"auth_disconnect"
,
{
vio_close
(
net
->
vio
);
DBUG_RETURN
(
1
);
});
DBUG_EXECUTE_IF
(
"auth_invalid_plugin"
,
client_auth_plugin
=
"foo/bar"
;
);
DBUG_ASSERT
(
client_auth_plugin
);
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment