DJS parsing

does DJS parse inputs from stuff like user tag to prevent exploits?
14 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Octoboomer
Octoboomer3mo ago
What exploit? Never heard of preventing an exploiting from parsing it
Amgelo
Amgelo3mo ago
if you mean like, sql injection, then no it doesn't strip anything, that'd be unexpected behavior for most users it should be safe to use ids directly however since that's not user input but generally it's better to go for the safe route
Wyv
WyvOP3mo ago
stuff like format string breakout, the one i'm specifically thinking of is user tags
Amgelo
Amgelo3mo ago
I'm not getting it
Wyv
WyvOP3mo ago
like if you have a string like console.log(`tag ${user.tag}`) you can breakout of that with the right input
Amgelo
Amgelo3mo ago
you can't though? :Thonk:
Wyv
WyvOP3mo ago
and that can lead to RCE
Amgelo
Amgelo3mo ago
unless you're evalling that input and at that point they can do anything
Wyv
WyvOP3mo ago
ok maybe not in that example, but other inputs you can true
Amgelo
Amgelo3mo ago
it's just a string, they can't make the string do anything by itself the only thing that can happen is if you then use that string somewhere else eg sql injection
Wyv
WyvOP3mo ago
ah ok that makes sense i just realized i was thinking more about C printf exploits not js :patrickconcern:
Amgelo
Amgelo3mo ago
oh yeah that exploit would make sense in C in js it'd just be treated as a regular string, even if it contains ${} and it's inside ``
Wyv
WyvOP3mo ago
ahhh ok that makes sense ty

Did you find this page helpful?