Skip to content

Commit

Permalink
rpc: prevent backupwallet method (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
phm87 authored and tpruvot committed Sep 3, 2018
1 parent 1da40e5 commit f93b3df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/yaamp/core/rpc/easybitcoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function __call($method, $params)
// The ID should be unique for each call
$this->id++;

if (stripos($method, 'dump') !== false) {
if (stripos($method, 'dump') !== false || stripos($method, 'backupwallet') !== false) {
$this->error = "$method method is not authorized!";
return FALSE;
}
Expand Down
2 changes: 1 addition & 1 deletion web/yaamp/core/rpc/wallet-rpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function __construct($userOrCoin, $pw='', $host='localhost', $port=8332, $url=nu

function __call($method, $params)
{
if (stripos($method, "dump") !== false) {
if (stripos($method, "dump") !== false || stripos($method, "backupwallet") !== false) {
$this->error = "$method not authorized!";
debuglog("$method rpc method is not authorized!");
return false;
Expand Down

4 comments on commit f93b3df

@phm87
Copy link
Author

@phm87 phm87 commented on f93b3df Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Do you think that importprivkey and invalidateblock methods should also be forbidden preventively ?

@tpruvot
Copy link
Owner

@tpruvot tpruvot commented on f93b3df Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

@huglester
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about dumpprivkey ?

@tpruvot
Copy link
Owner

@tpruvot tpruvot commented on f93b3df Sep 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't even merit an answer

Please sign in to comment.