|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31945 openssl_pkcs7_encrypt(), data interception is too easy
Submitted: 2005-02-12 08:45 UTC Modified: 2005-03-20 17:59 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ungdi at hotmail dot com Assigned:
Status: No Feedback Package: OpenSSL related
PHP Version: 5.0.3 OS: Windows Server 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ungdi at hotmail dot com
New email:
PHP Version: OS:


 [2005-02-12 08:45 UTC] ungdi at hotmail dot com
Currently, the openssl_pkcs7_encrypt() function as according to the documentation here:

Requires that the unencrypted input be a file already on the file system. This forces any PHP program having to output any form submission contents (destined to be an encrypted S/MIME e-mail) into the file system before encryption. After encryption is complete, it will be necessary to delete the file from the disk.

This method makes it trivial to recover the unencrypted information from the file on the disk through an undelete command or access of the drive data. Also, this causes the function to expose the unencrypted data on the disk to the whole system temporarily. During this window where the data is being encrypted, after the unencrypted data has been written to a file, it allows other programs or users to access the file and its unencrypted contents making it trivial to intercept the data being encrypted.

The function should be made to allow a string/data to be passed directly to the function without going through the file system. By allowing direct passing of the string to be encrypted to the openssl_pkcs7_encrypt() function, this decreases the surface area (possibility) and time frame in which someone can recover/access the unencrypted information.

Reproduce code:
Not applicable.

Expected result:
Not applicable.

Actual result:
Not applicable.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-12 09:52 UTC]
We do just what the openssl utility does itself.
Please submit a patch that implements this feature, and we'll gladly apply it.
 [2005-03-20 17:59 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 21:01:28 2024 UTC