Skip to content

Commit 66d6c21

Browse files
fix: prevent signers from seeing files with DRAFT sign_request status
Filter out sign_requests with status DRAFT (0) in the file list endpoint when the user is not the file owner. This ensures that signers do not see documents where their sign_request is in DRAFT status, unless they are the requester (owner) of the document. The filter is applied in the getFilesAssociatedFilesWithMeQueryBuilder method by adding conditions to exclude: - Files with status DRAFT (0) - Sign requests with status DRAFT (0) Only when the user is not the file owner (not matching f.user_id). This change affects only the /api/v1/file/list endpoint and does not impact other file access methods or signature flows. Ref: Security improvement to prevent premature document visibility Signed-off-by: Vitor Mattos <[email protected]>
1 parent f54bfe6 commit 66d6c21

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Db/SignRequestMapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ private function getFilesAssociatedFilesWithMeQueryBuilder(string $userId, array
527527
$qb->expr()->eq('f.user_id', $qb->createNamedParameter($userId)),
528528
$qb->expr()->andX(
529529
$qb->expr()->eq('im.identifier_key', $qb->createNamedParameter(IdentifyMethodService::IDENTIFY_ACCOUNT)),
530-
$qb->expr()->eq('im.identifier_value', $qb->createNamedParameter($userId))
530+
$qb->expr()->eq('im.identifier_value', $qb->createNamedParameter($userId)),
531+
$qb->expr()->neq('f.status', $qb->createNamedParameter(File::STATUS_DRAFT)),
532+
$qb->expr()->neq('sr.status', $qb->createNamedParameter(SignRequestStatus::DRAFT->value)),
531533
)
532534
];
533535
$qb->where($qb->expr()->orX(...$or))->andWhere($qb->expr()->isNull('id.id'));

0 commit comments

Comments
 (0)