security: sanitize markdown output and reduce PII logging
- Add isomorphic-dompurify to sanitize rendered docs HTML and Terms of Service - Remove addLdapUser full-object logging that included password hashes - Log only error name/message on auth/login failures instead of full LDAP error objects Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const router = require('express').Router();
|
||||
const {marked} = require('marked');
|
||||
const DOMPurify = require('isomorphic-dompurify');
|
||||
const conf = require('@simpleworkjs/conf');
|
||||
const buildInfo = require('../utils/build_info');
|
||||
const rateLimit = require('../middleware/rate_limit');
|
||||
@@ -131,7 +132,7 @@ router.get('/:slug', function(req, res, next) {
|
||||
docs: docList,
|
||||
currentSlug: req.params.slug,
|
||||
docTitle: doc.title,
|
||||
docHtml: fixDocLinks(fixImagePaths(marked(content))),
|
||||
docHtml: DOMPurify.sanitize(fixDocLinks(fixImagePaths(marked(content)))),
|
||||
});
|
||||
} catch (error) {
|
||||
next(error);
|
||||
|
||||
Reference in New Issue
Block a user