MPChecker 主要目的是检测分布式系统中权限检查缺失缺陷(missing permission check bugs, 缩写为MPC bugs)。
MPC bugs 是一类经典的缺陷,原因是需要鉴权的操作没有权限检查保护
public void deleteBlockPool(BlockPoolId blockPoolId, boolean force, String remoteUser) {
+ checkSuperuserPrivilege(remoteUser);//permission check hook
LOG.info("delete block pool {}", blockPoolId);
if (blockPoolManager.get(blockPoolId) != null) {
throw new IOException("...");
}
data.deleteBlockPool(blockPoolId, force);
}
public void checkSuperuserPrivilege(String remoteUser) {
if (!remoteUser.equals(this.superUser)){
throw new AccessControlException();
}
}如上,deleteBlockPool是需要鉴权的操作,但没有任何权限检查保护,导致任何用户都可删除系统中的关键数据,导致DOS共计。
和linux中的MPCbug 不同,分布式系统中的MPCbugs 有着自己的特征,详情。 相应的数据及其复现在doc目录中。
我们根据总结的特征,设计出MPCChecker,专用于检查分布式系统的MPChecker。