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

SyntaxError in Plus Viewer When DocumentType is not Tagged #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

austinmatherne-wk
Copy link
Contributor

If the DocumentType is not tagged, the instance section body ID will include parentheses (e.g., #instance-body-sectionDoc-(Source)), which results in an invalid CSS selector runtime exception. This issue prevents users from progressing beyond the Processing Inline Facts... loading screen unless the ID is properly escaped.

Example:
#instance-body-sectionDoc-(Source) div.accordion-body

You can reproduce this issue with the provided filing_documents.zip. However, any report missing the DocumentType tag will cause the same problem.

sections.ts:390 Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '#instance-body-sectionDoc-(Source) div.accordion-body' is not a valid selector.
    at Object.createMenuCatCollapsable (sections.ts:390:18)
    at sections.ts:297:26
    at Array.forEach (<anonymous>)
    at Object.buildSectionsDom (sections.ts:271:18)
    at Object.init (sections.ts:34:18)
    at Object.initialSetup (app.ts:164:18)
    at index.ts:26:17
    at p.init.i.onmessage (app.ts:79:29)

If DocumentType is not tagged, then the instance section body ID will
include parentheses which will raise an exception at runtime if not
escaped.

`#instance-body-sectionDoc-(Source) div.accordion-body`

sections.ts:390 Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '#instance-body-sectionDoc-(Source) div.accordion-body' is not a valid selector.
    at Object.createMenuCatCollapsable (sections.ts:390:18)
    at sections.ts:297:26
    at Array.forEach (<anonymous>)
    at Object.buildSectionsDom (sections.ts:271:18)
    at Object.init (sections.ts:34:18)
    at Object.initialSetup (app.ts:164:18)
    at index.ts:26:17
    at p.init.i.onmessage (app.ts:79:29)
@aviary-wf
Copy link

Security Insights

The items listed below may not capture all security relevant changes. Before providing a security review, be sure to review the entire PR for security impact.

(2) Security relevant changes were detected
  • Watched keyword .html(' in view/ixviewer-plus/dist/ix-viewer.bundle.8065996c58c3bb92d3b2.min.js.map line(s) ['1'] added
  • Watched keyword eval( in view/ixviewer-plus/dist/ix-viewer.bundle.8065996c58c3bb92d3b2.min.js.map line(s) ['1'] added
  • Action Items

    • Request infosec review via Slack: #support-infosec
    • Verify aviary.yaml coverage of security relevant code

    Questions or Comments? Reach out on Slack: #support-infosec.

    @freddym56
    Copy link

    @austinmatherne-wk i'm unable to replicate your issue. Steps take to try to reproduce below.

    1. Download attached zip
    2. Open Arelle and enable EDGAR Renderer plugin
    3. Under tools -> validation -> select disclosure system... -> select US SEC (EDGAR Filing Manual, Pragmatic)
    4. Open the zip file and select austin-20250115.htm file.
    5. When the FilingSummary page opens up I click on the yellow button (does not have any text because documentType is missing).
    6. Inline viewer loads ok and I can see 1 fact in the facts sidebar.

    filing_documents.zip

    @austinmatherne-wk
    Copy link
    Contributor Author

    Hi Freddy,

    Thanks for investigating.

    It looks like there's one additional requirement to reproduce the issue. An SEC disclosure system must not be selected.

    • With an SEC disclosure system the yellow button text is blank (and the corresponding CSS selector does not include the invalid (Source) string).
    • Without an SEC disclosure system the yellow button text is (Source) (and it's included in the CSS selector).

    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