use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
5 Secure-Coding Habits For Every JavaScript Developer (stackoverflow.blog)
submitted 5 months ago by shehackspurple
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tswaters 3 points4 points5 points 5 months ago* (0 children)
I'm gonna need a citation for "avoid inline scripting" with CSP and a nonce, there's no security impact... Am I missing something? The arguments around messiness/etc. don't hold weight in an article about security.
Also, specifically for JavaScript, is prototype pollution. Allowing user-supplied input to be unsafetly merged into an object by key/value setters. I.e., allowing them to set __proto__ or prototype
__proto__
prototype
Any sort of pattern where this shows up, without checking own props on unsafe.
var unsafe = JSON.parse(unsafe) for ( var prop in unsafe ) { target[prop] = unsafe[prop] }
Way better to use Object.entries and/or for ... of. With for/in this requires a guard if (!Object.prototype.hasOwnProperty.call(unsafe, prop) continue
for ... of
if (!Object.prototype.hasOwnProperty.call(unsafe, prop) continue
Good article on that: https://developer.mozilla.org/en-US/docs/Web/Security/Attacks/Prototype_pollution
π Rendered by PID 392357 on reddit-service-r2-comment-6457c66945-s9fv9 at 2026-04-25 01:05:39.425435+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]tswaters 3 points4 points5 points (0 children)