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

Cryptographic API Misuse Vulnerability #2337

Open
lialon opened this issue Aug 7, 2024 · 1 comment
Open

Cryptographic API Misuse Vulnerability #2337

lialon opened this issue Aug 7, 2024 · 1 comment

Comments

@lialon
Copy link

lialon commented Aug 7, 2024

Description:

In the "DeDRM_tools/DeDRM_plugin/adobekey.py", "DeDRM_tools/DeDRM_plugin/androidkindlekey.py", "DeDRM_tools/DeDRM_plugin/ignobleepub.py" and "DeDRM_tools/DeDRM_plugin/ignoblepdf.py" etc.. I have identified security vulnerabilities about insecure cryptographic algorithm.

ECB mode encryption is not semantically secure, which means it might cause information leakage.

PKCS1v1.5 is vulnerable to the chosen-ciphertext attack.

AES-CBC with fixed or hardcode IV is vulnerable to the chosen-ciphertext attack.

DES and RC4 is disallowed or for legacy use only.

Location:

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/adobekey.py#L165

self._aes = _AES.new(key, _AES.MODE_CBC, b'\x00'*16)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/androidkindlekey.py#L148

return DES.new(self.key, DES.MODE_CBC, self.iv)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ignobleepub.py#L168

self._aes = _AES.new(key, _AES.MODE_CBC, b'\x00'*16)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ignoblepdf.py#L203

self._arc4 = _ARC4.new(userkey)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ineptepub.py#L298

self._aes = _AES.new(key, _AES.MODE_CBC, b'\x00'*16)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ineptepub.py#L317

return _PKCS1_v1_5.new(self._rsa).decrypt(data, 172)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ineptpdf.py#L357

self._arc4 = _ARC4.new(userkey)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/ineptpdf.py#L390

return _PKCS1_v1_5.new(self._rsa).decrypt(data, 172)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/Obok_plugin/obok/obok.py#L255

self._aes = _AES.new(key, _AES.MODE_ECB)

https://github.com/apprenticeharper/DeDRM_tools/blob/master/Other_Tools/Kobo/obok.py#L249

self._aes = _AES.new(key, _AES.MODE_ECB)

Reference

Recommendate

  • Generate IV with cryptographic secure PRNG.

  • Use other cipher mode such as CFB or CTR with random IV.

  • Generate IV with cryptographic secure PRNG.

@ElleKayEm
Copy link

These vulnerabilities are in Adobe, Amazon, Kobo, and B&N's encryption which this plugin decrypts.

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

No branches or pull requests

2 participants