A very fashionable NPM package deal known as ‘pac-resolver’ for the JavaScript programming language has been mounted to handle a distant code execution flaw that would have an effect on numerous Node.js purposes.
The flaw within the pac-resolver dependency was discovered by developer Tim Perry who notes it may have allowed an attacker on a neighborhood community to remotely run malicious code inside a Node.js course of at any time when an operator tried to ship an HTTP request. Observe.js is the favored JavaScript runtime for operating JavaScript internet purposes.
“This package deal is used for PAC file assist in Pac-Proxy-Agent, which is utilized in flip in Proxy-Agent, which then used far and wide as the usual go-to package deal for HTTP proxy autodetection & configuration in Node.js,” explains Perry.
SEE: Developers, DevOps, or cybersecurity? Which is the top tech talent employers are looking for now?
PAC or “Proxy-Auto Config” refers to PAC information written in JavaScript to distribute advanced proxy guidelines that instruct an HTTP shopper which proxy to make use of for a given hostname, notes Perry, including these are broadly utilized in enterprise methods. They’re distributed from native community servers and from distant servers, typically insecurely over HTTP moderately than HTTPs.
It is a widespread subject as Proxy-Agent is utilized in Amazon Net Providers Cloud Growth Equipment (CDK), the Mailgun SDK and Google’s Firebase CLI.
The package deal will get three million downloads per week and has 285,000 public dependent repos on GitHub, Perry notes in a blogpost.
The vulnerability was mounted in v5.0.0 of all these packages lately and was marked as CVE-2021-23406 after it was disclosed final week.
It is going to imply numerous builders with Node.js purposes are doubtlessly affected and might want to replace to model 5.0.
It impacts anybody who is determined by Pac-Resolver previous to model 5.0 in a Node.js software. It impacts these purposes if builders have executed any of three configurations:
- Explicitly use PAC information for proxy configuration
- Learn and use the working system proxy configuration in Node.js, on methods with WPAD enabled
- Use proxy configuration (env vars, config information, distant config endpoints, command-line arguments) from some other supply that you just would not 100% belief to freely run code in your pc
“In any of these instances, an attacker (by configuring a malicious PAC URL, intercepting PAC file requests with a malicious file, or utilizing WPAD) can remotely run arbitrary code in your pc any time you ship an HTTP request utilizing this proxy configuration,” notes Perry.