
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@it-era/ngx-safe-pipes
Advanced tools
This library provide convenient pipes to bypass Angular built-in sanitization and get rid off the `unsafe value used in a ... context`.
This library provide convenient pipes to bypass Angular built-in sanitization and get rid off the unsafe value used in a ... context
.
This package is a part of the IT-era/ngx packages suite.
This package is available through the npm registry :
npm i @it-era/ngx-safe-pipes
Then add the NgxSafePipesModule
into the imports array of your module (containing the template to fix) :
import { NgxSafePipesModule } from '@it-era/ngx-safe-pipes'
@NgModule({
imports: [
NgxSafePipesModule,
// ...
],
})
export class YourModule {}
CAUTION: Calling thoses methods with untrusted user data exposes your application to XSS security risks!
Usage :
<div [innerHTML]="trustedHtml | safeHtml"></div>
Usage :
<img [attr.src]="trustedUrl | safeUrl">
NB: Usefull also for base64 images.
Usage :
<iframe [attr.src]="trustedResourceUrl | safeResourceUrl"></iframe>
Usage :
<script [attr.src]="trustedScript | safeScript"></script>
Usage :
<div [attr.style]="trustedStyle | safeStyle"></div>
Alternatively, you could use the generic SafePipe with the following syntax:
<div [innerHTML]="trustedHtml | safe: 'html'"></div>
<div [attr.style]="trustedStyle | safe: 'style'"></div>
<script [attr.src]="trustedScript | safe: 'script'"></script>
<img [attr.src]="trustedUrl | safe: 'url'">
<iframe [attr.src]="trustedResourceUrl | safe: 'resourceUrl'"></iframe>
You can find it here.
FAQs
This library provide convenient pipes to bypass Angular built-in sanitization and get rid off the `unsafe value used in a ... context`.
We found that @it-era/ngx-safe-pipes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.