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

Sanitise HTML in enterprise and product descriptions #12448

Open
3 of 4 tasks
mkllnk opened this issue May 8, 2024 · 4 comments
Open
3 of 4 tasks

Sanitise HTML in enterprise and product descriptions #12448

mkllnk opened this issue May 8, 2024 · 4 comments
Assignees

Comments

@mkllnk
Copy link
Member

mkllnk commented May 8, 2024

ℹ️ Please use project Discover Regenerative (Macdoch pt 2): #3A. Tech - OFN & OFN/DFC Endpoints to track work on this issue.

Description

When using a description on another website like the Discover Regenerative portal, any contained HTML tags should be safe.

Currently, the OFN UX allows only certain HTML tags to be inserted into a description. We do not check the content before storing it in the database. Instead, we sanitise the descriptions when displaying them withing the OFN app. Our APIs are not sanitising though, pushing the responsibility to all consumers of the APIs.

The knowledge of allowed HTML tags sits within OFN though and we could sanitise the HTML before storing it in the database. That would make further sanitising in the many other parts of the app redundant. It would also avoid consumers of APIs accidentally embedding unsafe HTML. It would be less work for everyone.

Acceptance Criteria & Tests

  1. All allowed HTML tags and attributes still work.
  2. All other tags and attributes, including dangerous tags like <script>, are filtered out before they are exposed on the DFC API.

Related issues:

@kirstenalarsen
Copy link
Contributor

@mkllnk please add clockify code to issue and associated pull requests

@rioug
Copy link
Collaborator

rioug commented May 27, 2024

@kirstenalarsen I can't see the clockfy code in this issue : Discover Regenerative (Macdoch pt 2): 3. Open Source Tech Evolution
I used Discover Regenerative (Macdoch pt 2): #3C. Tech - DR Site & Integration to log my code review for now, let me know if I need to update it.

@kirstenalarsen
Copy link
Contributor

Good pick up @rioug . I updated the project codes to give more specificity. Have just adjusted above - could you please switch your hours to #3A

@rioug
Copy link
Collaborator

rioug commented May 28, 2024

Done ! I also updated the description on the related PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Testing
Status: In Progress ⚙
Development

No branches or pull requests

3 participants