Skip to content

docs: add NG05201 - #69504

Merged
leonsenft merged 1 commit into
angular:mainfrom
arturovt:docs/errors_5200_5201
Jul 7, 2026
Merged

docs: add NG05201#69504
leonsenft merged 1 commit into
angular:mainfrom
arturovt:docs/errors_5200_5201

Conversation

@arturovt

Copy link
Copy Markdown
Contributor

See individual commits.

@pullapprove
pullapprove Bot requested a review from JeanMeche June 24, 2026 19:00
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Jun 24, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jun 24, 2026
Comment thread adev/src/content/reference/errors/NG05200.md Outdated
Comment thread adev/src/content/reference/errors/NG05200.md Outdated
Comment thread adev/src/content/reference/errors/NG05200.md Outdated
@arturovt arturovt changed the title Docs/errors 5200 5201 docs: add NG05200 and NG05201 Jun 25, 2026
@arturovt
arturovt force-pushed the docs/errors_5200_5201 branch from 188b137 to 1df1c1f Compare June 25, 2026 19:10
@arturovt arturovt changed the title docs: add NG05200 and NG05201 docs: add NG05201 Jun 29, 2026
@arturovt
arturovt force-pushed the docs/errors_5200_5201 branch from 1df1c1f to 1294666 Compare June 29, 2026 18:30
@@ -0,0 +1,43 @@
# Unsafe value used in a resource URL context

Angular throws this error when you bind a value to an attribute that loads an external resource — like `<iframe src>`, `<script src>`, or `<link href>` — and that value hasn't been explicitly marked as trusted.

@SkyZeroZx SkyZeroZx Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned earlier, the script wouldn't apply since it's not possible to write it in a template and due to its nature

EDIT : I'm referring to removing only <script src> since it doesn't add value and would be confusing because that case can't currently happen.

@JeanMeche JeanMeche Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you're saying that is no way to get 5201 anymore because throw NG0904?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand and have reviewed,

So, to summarize, I would say that it is no longer possible according to our current sanitization model.

The only way would be to create a script with document or Render2 , which is inherently unsafe according to the documentation because it occurs outside the scope of Angular.

Adds a reference page for `NG05200`, thrown by `DomSanitizer` when a value is bound to a `<script>` element without being marked trusted via `bypassSecurityTrustScript`. Covers why Angular rejects script content outright, how to reproduce the error, the escape hatch, and the XSS caveat.
@arturovt
arturovt force-pushed the docs/errors_5200_5201 branch from 1294666 to 24585f9 Compare June 30, 2026 18:45
Comment thread adev/src/content/reference/errors/NG05201.md
@pullapprove
pullapprove Bot requested review from JeanMeche and atscott July 7, 2026 15:15
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jul 7, 2026

@JeanMeche JeanMeche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@JeanMeche

Copy link
Copy Markdown
Member

caretaker note: no need to presubmit, this is a doc only change.

@JeanMeche
JeanMeche removed the request for review from atscott July 7, 2026 15:15
@leonsenft
leonsenft merged commit 806a3ad into angular:main Jul 7, 2026
27 of 29 checks passed
@leonsenft

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@arturovt
arturovt deleted the docs/errors_5200_5201 branch July 7, 2026 17:54
@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Aug 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: docs Related to the documentation merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants