5

Fix rpc server permissions by disconnect3d · Pull Request #238 · iovxw/gleipnir...

 2 years ago
source link: https://github.com/iovxw/gleipnir/pull/238
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

disconnect3d commented on Aug 23, 2021

Fixes the rpc server socket permissions from:

fs::set_permissions(&addr, fs::Permissions::from_mode(755))?;
fs::set_permissions(&addr, fs::Permissions::from_mode(0o755))?;

The difference is subtle and can be seen below - with the old permission, any user on the system could write to the socket:

In [15]: os.chmod('x', 755)

In [16]: !ls -la x
--wxrw--wt  1 dc  staff  0 Aug 23 19:52 x

In [17]: os.chmod('x', 0o755)

In [18]: !ls -la x
-rwxr-xr-x  1 dc  staff  0 Aug 23 19:52 x

I haven't really checked the impact of this issue, but if writing to RPC allows for some interesting actions and the daemon runs as root then oh well...


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK