1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-03 12:12:43 +01:00
phorge-phorge/src/applications/files/storage
epriestley 63828f5806 Store and verify content integrity checksums for files
Summary:
Ref T12470. This helps defuse attacks where an adversary can directly take control of whatever storage engine files are being stored in and change data there. These attacks would require a significant level of access.

Such attackers could potentially attack ranges of AES-256-CBC encrypted files by using Phabricator as a decryption oracle if they were also able to compromise a Phabricator account with read access to the files.

By storing a hash of the data (and, in the case of AES-256-CBC files, the IV) when we write files, and verifying it before we decrypt or read them, we can detect and prevent this kind of tampering.

This also helps detect mundane corruption and integrity issues.

Test Plan:
  - Added unit tests.
  - Uploaded new files, saw them get integrity hashes.
  - Manually corrupted file data, saw it fail. Used `bin/files cat --salvage` to read it anyway.
  - Tampered with IVs, saw integrity failures.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12470

Differential Revision: https://secure.phabricator.com/D17625
2017-04-05 11:12:31 -07:00
..
__tests__ Remove SHA1 file content hashing and make Files work without any hashing 2017-04-04 16:22:10 -07:00
PhabricatorFile.php Store and verify content integrity checksums for files 2017-04-05 11:12:31 -07:00
PhabricatorFileChunk.php Remove empty implementations of describeAutomaticCapabilities() 2016-11-09 15:24:22 -08:00
PhabricatorFileDAO.php Remove @group annotations 2014-07-10 08:12:48 +10:00
PhabricatorFileExternalRequest.php Endpoint+controller for a remarkup image proxy 2016-09-23 10:28:24 -04:00
PhabricatorFileSchemaSpec.php Automatically build all Lisk schemata 2014-10-02 09:51:20 -07:00
PhabricatorFileStorageBlob.php Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00
PhabricatorFileTransaction.php Move Files to ModularTransactions 2017-04-04 10:25:05 -07:00
PhabricatorFileTransactionComment.php Allow file comments to be edited 2016-07-18 16:17:43 -07:00
PhabricatorTransformedFile.php Fix visiblity of LiskDAO::getConfiguration() 2015-01-14 06:54:13 +11:00