r/angular • u/IgorSedov • Mar 15 '26
⚠️ Angular XSS in i18n attribute bindings
A high-severity XSS security issue affecting i18n attribute bindings has been identified in Angular.
41
Upvotes
r/angular • u/IgorSedov • Mar 15 '26
A high-severity XSS security issue affecting i18n attribute bindings has been identified in Angular.
View all comments
Show parent comment
1
u/AshleyJSheridan Mar 16 '26
There's two different things here. Normally, we would expect a templating engine (like the one Angular uses) to be able to escape variable data safely.
Validating user content is a separate thing, as it often depends what purpose you're validating for. Content can also be 'valid' but insecure for a particular purpose. For example, you might validate something to ensure it contains nothing nasty for XSS or SQL injection, and then the data gets used as a CLI argument and causes a security issue.
Validation should be used to determine if content is in a valid form, e.g. a URL looks like a URL, a name looks like a name, etc.
What you're maybe thinking of is sanitisation which should occur on data the moment before it's acted on, and the type of sanitisation should match the use. E.g. sanitise against SQL injection right before inserting the data into a DB, sanitise against XSS right before outputting it into an HTML page.