You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: complete security fixes — SQLi in AuthController/BlogController/Controller, DOMPurify lib, CSRF meta tags, fullName XSS
- Parameterize all remaining where= string interpolation in AuthController (12 locations),
BlogController (5 locations), and Controller (8 locations)
- Add purify.min.js (DOMPurify 3.2.4) to public/javascripts/lib/
- Add <meta name="csrf-token"> to both layout.cfm and admin layout.cfm
- Encode fullName in show.cfm comment rendering (lines 139, 192)
- Add authenticityToken to bookmark.js and reading-tracker.js fetch body params
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
// Shared business logic across multiple controllers
103
104
publicfunctiongetBlogBySlug(requiredstringslug) {
104
105
returnmodel("Blog").findOne(
105
-
where="blog_posts.slug = '#arguments.slug#' AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#now()#'",
106
+
where="blog_posts.slug = :slug AND blog_posts.status = 'Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= :now",
varexistingToken=model("UserToken").findOne(where="user_id = #val(user.id)# AND status = 'false'");
794
+
varexistingToken=model("UserToken").findOne(where="user_id = :userId AND status = 'false'", params={userId={value=val(user.id), cfsqltype="cf_sql_integer"}});
where ="blog_posts.status ='Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#Now()#' AND (blog_posts.slug LIKE '#searchPattern#' OR blog_posts.title LIKE '#searchPattern#' OR blog_posts.content LIKE '#searchPattern#' OR fullname LIKE '#searchPattern#' OR email LIKE '#searchPattern#')",
377
+
where ="blog_posts.status ='Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#Now()#' AND (blog_posts.slug LIKE :pattern OR blog_posts.title LIKE :pattern OR blog_posts.content LIKE :pattern OR fullname LIKE :pattern OR email LIKE :pattern)",
where ="blog_posts.status ='Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#Now()#' AND (blog_posts.slug LIKE '#searchPattern#' OR blog_posts.title LIKE '#searchPattern#' OR blog_posts.content LIKE '#searchPattern#' OR fullname LIKE '#searchPattern#' OR email LIKE '#searchPattern#')"
388
+
where ="blog_posts.status ='Approved' AND blog_posts.publishedAt IS NOT NULL AND blog_posts.publishedAt <= '#Now()#' AND (blog_posts.slug LIKE :pattern OR blog_posts.title LIKE :pattern OR blog_posts.content LIKE :pattern OR fullname LIKE :pattern OR email LIKE :pattern)",
0 commit comments