Node.js · Senior · Question 29 of 75

Your API fetches a URL supplied by the user (e.g. for link previews). What attack must you prevent?

Explanation

Allow only needed schemes and ports, resolve the host and block private and link-local ranges, disable or re-check redirects, and use network-level egress rules.

Further reading

Problem with a question

Node.js · Senior · question 29

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz