You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If url contains malicious content like javascript:alert(1) or " onclick="alert(1), this creates XSS vulnerabilities.
Additionally, the raw_html cook method (line 22, 36) bypasses all sanitization, allowing any JavaScript/HTML from external sources to execute in users' browsers.
There's a check-then-act race condition. Between checking and creating, another process could create the embed. The transaction in TopicEmbed.import helps, but consider using database-level uniqueness constraints.
8. Missing Error Handling
Location:app/jobs/scheduled/poll_feed.rb:29-36
No error handling for:
Network failures when fetching the feed
Invalid RSS/XML parsing
Individual item processing failures (one bad item breaks the entire feed)
Should wrap in begin/rescue and log errors without breaking the job.
No validation that embed_url is actually a valid URL format before using it. Should validate format and potentially that it matches the allowed embeddable_host.
If both i.link and i.id are invalid URLs, this will pass a non-URL string to TopicEmbed.import, which will silently fail (line 11 of topic_embed.rb checks the pattern).
The feature implementation is solid, but the security issues are blocking. The SSRF and XSS vulnerabilities could lead to serious exploits and must be addressed before this can be merged safely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test 4nn---nReplicated from ai-code-review-evaluation/discourse-greptile#4