question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(icon): validation method does not properly check attributes starting with 'on'

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

I found a bug related to the icon sanitize method that could affect the security of the component.

Basically, in the isValid method, where you should check that no attribute starts with on, what actually happens is that the value is checked and not the name of the attribute itself. In this way, as shown below, you could render an icon that on click triggers a function:

image

I would also suggest, as you can see from the image above, to add two new icons to show in the “Sanitized (shouldn’t show)” and “Not Sanitized (should show)” sections (e.g. sanitize-attr.svg and no-sanitize-attr.svg).

Expected Behavior

The validation method should properly check attributes starting with ‘on’ on the icons.

Steps to Reproduce

Add to an svg any attribute starting with ‘on’ (e.g. ‘onclick’).

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.20.1

Utility:

cordova-res : not installed globally native-run : not installed globally

System:

NodeJS : v18.7.0 npm : 8.15.0 OS : macOS Monterey

Additional Information

I’ve already opened an issue in the ion-icon repo: https://github.com/ionic-team/ionicons/issues/1088. There is also a PR to fix the problem: https://github.com/ionic-team/ionicons/pull/1087.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Aug 26, 2022

Ionic Framework v6 now installs Ionicons 6.0.3 or newer (within version 6.x). An update will go out in the next release of Ionic Framework that will upgrade all apps to Ionicons 6.0.3 or newer.

Developers can get Ionicons 6.0.3 right now by explicitly installing ionicons@6.0.3 in their project.

Thanks again for the report and fix! I am going to close this as the issue has been resolved.

0reactions
ionitron-bot[bot]commented, Sep 25, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug your layout with Layout Inspector and Layout Validation
The Layout Inspector in Android Studio allows you to debug the layout of your app by showing a view hierarchy and allowing you...
Read more >
<input>: The Input (Form Input) element - HTML
If this attribute is not specified, the default type adopted is text . ... Looks like a text input, but has validation parameters...
Read more >
Validation of a list of objects in Spring - Stack Overflow
The problem is that validation is not triggered, the CompanyTag list is not validated, the "StringUUIDValidation" validator is never called. If I remove...
Read more >
HTML5 Form Validation Examples < HTML - The Art of Web
HTML5 form input field attributes in combination with CSS allow you to provide instant feedback on the validity of form input text, including...
Read more >
Patch Notes | Odin Inspector for Unity
Added SDF Icons to the InfoMessageBox attribute and added SirenixGUIStyles. ... The trial version of Odin Inspector now doesn't disable the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found