WebJET CMS layers security at every tier: REST controller authorization, JPA-level HTML sanitization, audit logging of every admin action, and automated vulnerability scanning of third-party libraries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/webjetcms/webjetcms/llms.txt
Use this file to discover all available pages before exploring further.
Dependency vulnerability scanning
The project integrates OWASP Dependency-Check, which scans both Java and JavaScript libraries for known CVEs. Run it with:build/reports/dependency-check-report.html. Review it before every release.
Suppressing false positives
The scan may surface false positives. Two suppression files are available:| File | Purpose |
|---|---|
/dependency-check-suppressions.xml | Standard WebJET suppressions — do not modify |
dependency-check-suppressions-project.xml | Project-specific suppressions — add your exceptions here |
<suppressions> element in dependency-check-suppressions-project.xml.
REST controller authorization
WebJET CMS extends Spring Security. Protect every REST controller with@PreAuthorize so that unauthenticated or insufficiently privileged requests are rejected before any business logic runs.
@PreAuthorize annotation is evaluated by Spring Security’s method-security infrastructure before the controller method executes. Use WebJET’s @WebjetSecurityService.hasPermission with the relevant permission key for your module.
DataTable security hooks
TheDatatableRestControllerV2 base class exposes beforeSave and beforeDelete hook methods you can override to enforce fine-grained access control on individual records.
XSS protection and HTML sanitization
Default XSS escaping
By default, when a JPA entity is loaded from the database, allString attributes are automatically escaped: < and > are converted to HTML entities (<, >). This is handled transparently by XssAttributeConverter, which is registered globally via @Converter(autoApply = true).
This means you do not need to manually escape entity fields when rendering them — the converter protects against reflected XSS for all plain-text fields.
Allowing HTML in a field
If a field is intended to hold HTML (for example, a WYSIWYG editor field of typeDataTableColumnType.QUILL), you must explicitly opt in to one of two converters:
AllowSafeHtmlAttributeConverter
Strips dangerous tags and attributes while preserving basic formatting. Backed by the OWASP Java HTML Sanitizer. Recommended for all WYSIWYG fields.
AllowHtmlAttributeConverter
Allows all HTML including scripts. Use only when the field is genuinely expected to contain executable code and is accessible only to trusted administrators.
Auditing user actions
Automatic JPA entity auditing
Add@EntityListeners(AuditEntityListener.class) and @EntityListenersType to a JPA entity to automatically record every create, update, and delete to the audit log. The listener captures old and new values and writes a human-readable diff.
| Callback | What is recorded |
|---|---|
postPersist | All field values of the new record |
preUpdate / postUpdate | Only the changed fields (old value → new value) |
preRemove | All field values of the deleted record |
Audit log format
Hiding sensitive fields from the audit
The configuration variableauditHideProperties holds a comma-separated list of attribute names whose values are replaced with ***** in the audit log. The default value is password,password2,password_salt. Add any additional sensitive field names to this variable in the administration.
Technical note: getting pre-update state
Fetching the current database state before a JPA update is non-trivial because the entity managed in the current session already reflects the new values.AuditEntityListener solves this by opening a separate EntityManager to load the original record for comparison. Objects loaded through Spring Data JPA are not affected by this issue because Spring Data uses its own EntityManager internally.