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

fix(gif): Restrict gif rendering to Giphy only #14988

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Conversation

hristoterezov
Copy link
Member

No description provided.

@hristoterezov hristoterezov marked this pull request as ready for review August 8, 2024 18:39
@saghul
Copy link
Member

saghul commented Aug 8, 2024

Pl also drop the proxy sample from resources/

@bgrozev
Copy link
Member

bgrozev commented Aug 8, 2024

Missing check for disableThirdPartyRequests

@hristoterezov
Copy link
Member Author

Pl also drop the proxy sample from resources/

Done!

@hristoterezov
Copy link
Member Author

Missing check for disableThirdPartyRequests

What do you mean? Where?

I've added bunch of isGifEnabled checks and they include disableThirdPartyRequests check + if giphy is enabled trough config or dynamic branding and some more checks. I think those are enough?

@hristoterezov
Copy link
Member Author

The shared video test is failing but it seems we have a general issue with it because even vanilla jitsi-meet PR makes it fail. Tested manually and it works. I think we can merge this PR!

config.js Outdated
// rating: 'pg',
// // The proxy server url for giphy requests in the web app.
// proxyUrl: 'https://giphy-proxy.example.com',
// rating: 'pg'
Copy link
Member

Choose a reason for hiding this comment

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

Nit: leave the trailing comma, so adding new options doesn't result in a syntax error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

return false;
}

return Boolean(hostname) && Boolean(GIF_HOST_WHITELIST.find(h => h === hostname));
Copy link
Member

Choose a reason for hiding this comment

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

Since it's oonly 1 domain, it's more resilient to do an equaality check. This way any prototype pollution bug doesn't render this protection useless.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK

/**
* Whether the gifs are enabled or not.
*/
gifEnabled?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Can you modify isGifEnabled to always return a boolean, it makes no sense that it can return undefined. This way it can default to false I guess, rather than haveing to do it everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

it actually always returns boolean.

Fixed!

@hristoterezov hristoterezov merged commit 2002283 into master Aug 9, 2024
9 checks passed
@hristoterezov hristoterezov deleted the gif-whitelist branch August 9, 2024 15:01
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

Successfully merging this pull request may close these issues.

3 participants