Skip to content

Provide a warning about xss implications #7

@chrissrogers

Description

@chrissrogers
t('{hasOwnProperty(alert("xss"))}');

demonstrates the translation string as a potential xss vector. It's not hinted anywhere in the API docs that one should stick external vars in the translation string, but it might be helpful to mention that such a thing should be avoided.

In lieu of a disclaimer, it would be possible to remove the vulnerability by splitting tokens by the dot and recursing down obj with string accessors.

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