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 html decoding in Job Viewer -> Edit Search #1268

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

jpwhite4
Copy link
Member

@jpwhite4 jpwhite4 commented Mar 19, 2020

Original Bug Report:

https://app.asana.com/0/342819846538629/828830620362347

When entering a Search Title that contains html encodable values ( <, >,
& etc ), saving and then editing the search causes the encoded title to
be editable, not the decoded title.
Example:

  • Search Title: Pwned!<script>alert(1)</script>
    • When viewed this displays correctly as text. But if you 'edit' the
      search you will instead see
      the value below.
  • Encoded: Pwned!&lt;script&gt;alert(1)&lt;/script&gt;
    • This is what you see when editing the search.
  • If you save the search after editing it then it will then become:
    • Pwned!&lt;script&&lt/script&>

Description:

the .text element contains html content. but you have to put normal
text in the form field.

--

Notes

the actual fix for the problem is the one line change to add the Ext.util.Format.htmlDecode call in SearchPanel.js. However, on inspection of the code, the html sanitization was being performed in the client rather than the server. This is a serious bug. Since both fixes are needed and they both impact the same code flow this pull request fixes both bugs.

Original Bug Report:

https://app.asana.com/0/342819846538629/828830620362347

When entering a Search Title that contains html encodable values ( <, >,
& etc ), saving and then editing the search causes the encoded title to
be editable, not the decoded title.
Example:
  - Search Title: Pwned!<script>alert(1)</script>
    - When viewed this displays correctly as text. But if you 'edit' the
search you will instead see
      the value below.
  - Encoded: Pwned!&lt;script&gt;alert(1)&lt;/script&gt;
    - This is what you see when editing the search.
   - If you save the search after editing it then it will then become:
     - Pwned!&amp;lt;script&amp;&lt/script&amp;&gt;

Description:

the .text element contains html content. but you have to put normal
text in the form field.
@jpwhite4 jpwhite4 merged commit a0e2d3b into ubccr:xdmod9.0 Mar 20, 2020
@jpwhite4 jpwhite4 deleted the jvadv_merge branch March 20, 2020 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants