[MDEV-29746] BINLOG REPLAY privilege is sufficient to manipulate history of any versioned table Created: 2022-10-08  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Authentication and Privilege System, Versioned Tables
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

System versioning history can be modified (inserted, updated, deleted) by executing a row event via BINLOG command, regardless of the value of secure_timestamp.

create database db;
create table db.t (a int) with system versioning;
 
create user ubinlog;
grant BINLOG REPLAY on *.* to ubinlog;
 
--connect(con1,localhost,ubinlog,,)
 
# Format description event
BINLOG '
719BYw8BAAAA/AAAAAABAAAAAAQAMTAuMTEuMC1NYXJpYURCLWRlYnVnLWxvZwAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADvX0FjEzgNAAgAEgAEBAQEEgAA5AAEGggAAAAICAgCAAAACgoKAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAEEwQADQgICAoKCgFOe+tK
'/*!*/;
 
# Write event, inserting a 3-field row into db.t table
BINLOG '
KmBBYxMBAAAALgAAAMQDAAAAABIAAAAAAAEAAmRiAAF0AAMDERECBgYH/lbeqQ==
KmBBYxcBAAAANAAAAPgDAAAAABIAAAAAAAEAA//4AQAAAGHPfWAAAABjsLDgAAAAwopO7w==
'/*!*/;
 
--disconnect con1
--connection default
 
select a, row_start, row_end from db.t for system_time all;
 
# Cleanup
drop database db;
drop user ubinlog;

(for 10.3/10.4 BINLOG REPLAY in the test case needs to be replaced by SUPER).

10.5 7865c8c9

connection default;
select a, row_start, row_end from db.t for system_time all;
a	row_start	row_end
1	2022-01-01 00:00:00.000000	2023-01-01 00:00:00.000000



 Comments   
Comment by Sergei Golubchik [ 2022-10-17 ]

This came from MDEV-22012

Generated at Thu Feb 08 10:10:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.