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

xss: Prevent Shared XSS Attachments #3962

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

JediKev
Copy link
Contributor

@JediKev JediKev commented Sep 14, 2017

This addresses an issue where a User can upload an XSS infected
attachment to a ticket, share the file link with another person, and the
person will be able to view/download the attachment. This adds a check to
see if the attachment is apart of a ticket and if it is then only Users
associated with the ticket can view the attachment. You have to enable
the setting ‘Login Required to view attachments’ for this to work.

This addresses an issue where a User can upload an XSS infected
attachment to a ticket, share the file link with another person, and the
person will be able to view/download the attachment. This adds a check to
see if the attachment is apart of a ticket and if it is then only Users
associated with the ticket can view the attachment. You have to enable
the setting ‘Login Required to view attachments’ for this to work.
@JediKev JediKev added the review label Mar 5, 2020
@@ -39,6 +39,18 @@
require 'secure.inc.php';
}
}
} elseif ($cfg->isAuthRequiredForFiles() && $thisclient) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combine into:

if ($cfg->isAuthRequiredForFiles()) { 
    if ($thisclient) {
        xxx
    } else {
        xxx
    } 
}

$attachment = $file->attachments->findFirst();
if (($thread = $attachment->getObject()->getThread()) && $thread->getObjectType() == 'T') {
$recipients = $thread->getObject()->getRecipients();
foreach($recipients as $r) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ORM lookup is faster

@JediKev JediKev requested a review from protich March 10, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant