
Security News
crates.io Ships Security Tab and Tightens Publishing Controls
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.
sanitize-input
Advanced tools
Scrub user inputs with the Sanitizer Web API.
The Sanitizer Web API is currently in development, try to use Chrome Canary with chrome://flags/#enable-experimental-web-platform-features enabled, or Firefox Nightly with dom.security.sanitizer.enabled set to true.
npm install sanitize-input
import Sanitize from 'sanitize-input';
class App extends React.Component {
constructor() {
this.state = { inputText: 'none' };
this.onChange = this.onChange.bind(this);
}
onChange(e) {
this.setState({ inputText: Sanitize(e.target.value) });
}
render() {
return (
<div>
<input type="text" onChange={this.onChange} />
<p>{this.state.inputText}</p>
</div>
);
}
}
import Sanitize from 'sanitize-input';
class App extends React.Component {
constructor() {
this.state = { inputText: 'none' };
this.onChange = this.onChange.bind(this);
}
onChange(e) {
this.setState({ inputText: e.target.sanitizedValue });
}
render() {
return (
<div>
<input type="text" onChange={Sanitize(this.onChange)} />
<p>{this.state.inputText}</p>
</div>
);
}
}
MIT
FAQs
sanitize input elements with sanitizer web api
The npm package sanitize-input receives a total of 4 weekly downloads. As such, sanitize-input popularity was classified as not popular.
We found that sanitize-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.