Skip to content

Rename decode function unsafeDecode to highlight the risk #952

Open
@marine-mb

Description

@marine-mb

Describe the problem you'd like to have solved

I'm a DevSec. I help developers teams find and fix their vulnerabilities.
In two of my last missions, I've seen developers using decode instead of verify even if the documentation has been improved.

Describe the ideal solution

To avoid this and reduce the vulnerable apps, I think it would be great to rename the decode function and call it unsafeDecode. (as suggested by @youssef-jbili)

Other libraries have done it and it helps developers reduce their mistakes:

  • dangerouslySetInnerHTML for React
  • bypassSecurityTrustHtml for Angular

I can make a Pull Request if you think it is a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions