Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible vulnerabilities in the encryption process. #96

Open
tbrezot opened this issue Feb 8, 2023 · 1 comment
Open

Possible vulnerabilities in the encryption process. #96

tbrezot opened this issue Feb 8, 2023 · 1 comment
Labels
security Something is not secure

Comments

@tbrezot
Copy link
Collaborator

tbrezot commented Feb 8, 2023

Attack on the policy

Description

The policy is not a cryptographic key, but it is a really sensitive object.

An attacker could trick a user into encrypting data for the wrong right (e.g. one the attacker is entitled to) by providing him with a modified policy.

For example, exchanging the attribute values of the Top Secret attribute with those of the Low Secret attribute would lead to actually encrypt for Department::FIN && Security Level::Low Secret when trying to encrypt for Department::FIN && Security Level::Top Secret.

Fix

The validity of the policy should be checked before each use. This could be done by signing the policy with the master secret key. This signature could be check using the public key.

Attack on the public key

Description

An attacker could trick a user into encrypting data for the wrong right (e.g. one the attacker is entitled to) by providing him with a modified public key.

For example, exchanging the value of a Security Level::Top Secret partition with the one of a Security Level::Low Secret partition in the public key HashMap would lead to actually encrypt for the later partition when trying to encrypt for former one.

Fix

The validity of the public key should be checked before each use. This could be done by signing the public key with the master secret key. This signature could be check using the public key.

@tbrezot tbrezot added the security Something is not secure label Feb 8, 2023
@tbrezot
Copy link
Collaborator Author

tbrezot commented Feb 8, 2023

The fix proposed to mitigate the attack on the public key involves using s1 or s2. This may not be secure as these keys are already use to derive the user secret keys.

An alternative fix would be to store a hash of the public key in the user secret keys. These hash would be protected from forgery by implementing the change proposed in #77. This would lead to increase the user keys by another 16 bytes. I would argue this is not an issue since this size increase is distributed among users and a central key management server could generate user keys on the fly if the number of user keys it has to store makes their size a problem.

The same fix could also be used to check the validity of the policy. Both could be done in the same time by implementing the change proposed in #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Something is not secure
Projects
None yet
Development

No branches or pull requests

1 participant