Registry / other / encoder

encoder

JSON →
library1.4.0javamavenunverified

A high-performance contextual encoder library to prevent Cross-Site Scripting (XSS) by encoding untrusted data for HTML, JavaScript, CSS, and URLs.

<dependency> <groupId>org.owasp.encoder</groupId> <artifactId>encoder</artifactId> <version>1.4.0</version> </dependency>
INSTALL
IMPORT
SIG · ENCODER
E
encoder
otherjavav1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Encode
✓ org.owasp.encoder.Encode

Encodes a user input string for safe inclusion in HTML.

import org.owasp.encoder.Encode; public class Example { public static void main(String[] args) { String userInput = "<script>alert('xss')</script>"; String safeHtml = Encode.forHtml(userInput); System.out.println(safeHtml); } }
Debug
Known issues
gotchaEnsure you use the correct encoding method for the context (e.g., forHtml vs forJavaScript) to avoid bypasses.
fix
Always match the encoding method to the output context (HTML attribute, JavaScript string, etc.).
affects: *
Upgrade
Version history
1.4.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
encoder — mvn dependency:get encoder · libregistry