-
Notifications
You must be signed in to change notification settings - Fork 8.2k
cross-origin iframes with depth limits #2766
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 4 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
- Updated logging statements to use multi-line formatting for better clarity. - Ensured consistent spacing and formatting throughout the service to enhance code maintainability.
Agent Task Evaluation Results: 2/4 (50%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
- Updated the method of accessing iframe dimensions from dictionary-style to attribute-style for improved clarity and consistency. - Ensured that width and height are directly accessed as properties of the bounds object.
…erialization depth handling
…rity and performance
self.logger.warning( | ||
f'⚠️ Limiting processing of {original_doc_count} iframes on page to only first {MAX_TOTAL_IFRAMES} to prevent crashes!' | ||
) | ||
snapshot['documents'] = snapshot['documents'][:MAX_TOTAL_IFRAMES] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Iframe Limitation Affects Main Frame
The MAX_TOTAL_IFRAMES
constant is intended to limit the number of iframe documents, but the current logic applies this limit to the total documents, including the main frame. This means fewer iframes are processed than expected, and the warning message about "iframes" is inaccurate.
Additional Locations (1)
"""Step 1: Create a simplified tree with enhanced element detection.""" | ||
|
||
# Prevent infinite recursion by limiting depth to 30 levels | ||
if depth > 30: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MagMueller, Thanks for making the iframe count and depth configurable(#3026), but since it’s still hardcoded, it caused me some trouble while debugging.
Our webapp is fairly complex with a large hierarchy of elements, so 30 is a bit too low for our needs.
Could you also consider this and the other bugs under #nicehack69 (most bugs found category)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what depth do you need @shivamkhatri?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary by cubic
Enable cross-origin iframe support by default with strict depth and count limits to prevent DOM explosions. Improves embedded content coverage while keeping performance stable and hardening dialog handling.
New Features
Bug Fixes