<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prithwiraj Bose</title>
    <description>The latest articles on DEV Community by Prithwiraj Bose (@sribasu).</description>
    <link>https://dev.to/sribasu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1535097%2Fda19ae41-d945-4d67-a0bc-14c940c8ef30.jpg</url>
      <title>DEV Community: Prithwiraj Bose</title>
      <link>https://dev.to/sribasu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sribasu"/>
    <language>en</language>
    <item>
      <title>The Hard Part of Leaving `request` is the App Built Around It</title>
      <dc:creator>Prithwiraj Bose</dc:creator>
      <pubDate>Sun, 01 Nov 2026 20:41:25 +0000</pubDate>
      <link>https://dev.to/sribasu/the-hard-part-of-leaving-request-is-the-app-built-around-it-4d61</link>
      <guid>https://dev.to/sribasu/the-hard-part-of-leaving-request-is-the-app-built-around-it-4d61</guid>
      <description>&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I maintain &lt;a href="https://www.npmjs.com/package/request-to-axios" rel="noopener noreferrer"&gt;request-to-axios&lt;/a&gt;. This is a migration guide from the perspective of someone maintaining legacy Node.js code, not an independent review of my own package.&lt;/p&gt;

&lt;p&gt;When a project uses &lt;code&gt;request&lt;/code&gt;, replacing the dependency can look like a one-line change. The hard part usually isn't translating &lt;code&gt;request.get()&lt;/code&gt; to &lt;code&gt;axios.get()&lt;/code&gt;. It's finding all the assumptions accumulated around the old call: callbacks that expect &lt;code&gt;(error, response, body)&lt;/code&gt;, stream piping, &lt;code&gt;formData&lt;/code&gt;, &lt;code&gt;qs&lt;/code&gt;, cookies, default headers, odd redirects, and tests that depend on the response being text unless &lt;code&gt;json&lt;/code&gt; is enabled.&lt;/p&gt;

&lt;p&gt;A broad rewrite can turn a small security task into a risky application migration. That is why I built a compatibility wrapper around Axios: to make an incremental transition possible for common request patterns, while keeping unsupported behavior visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the Dependency Deserves Attention
&lt;/h2&gt;

&lt;p&gt;The latest upstream &lt;code&gt;request&lt;/code&gt; release is still &lt;code&gt;2.88.2&lt;/code&gt;. The maintainers marked the project deprecated in 2020 and say no new changes are expected. That fact alone does not mean every application is exploitable. The more useful question is what versions your install resolves and whether your code reaches an affected behavior.&lt;/p&gt;

&lt;p&gt;On 2026-11-02, I installed &lt;code&gt;request@2.88.2&lt;/code&gt; into a temporary project and ran &lt;code&gt;npm audit&lt;/code&gt;. It resolved &lt;code&gt;form-data@2.3.3&lt;/code&gt;, &lt;code&gt;qs@6.5.5&lt;/code&gt;, &lt;code&gt;tough-cookie@2.5.0&lt;/code&gt;, and &lt;code&gt;uuid@3.4.0&lt;/code&gt;, alongside the deprecated request package. npm reported five vulnerable package nodes, with multiple advisories applying to some nodes.&lt;/p&gt;

&lt;p&gt;A few examples from that graph:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/advisories/GHSA-p8p7-x288-28g6" rel="noopener noreferrer"&gt;&lt;code&gt;CVE-2023-28155&lt;/code&gt;&lt;/a&gt; is an SSRF mitigation bypass in &lt;code&gt;request&lt;/code&gt; through 2.88.2 involving cross-protocol redirects. It matters when an application relies on URL or redirect restrictions to protect requests to internal services.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/advisories/GHSA-fjxv-7rqg-78g4" rel="noopener noreferrer"&gt;&lt;code&gt;CVE-2025-7783&lt;/code&gt;&lt;/a&gt; affects old &lt;code&gt;form-data&lt;/code&gt; boundary generation. Exploitation depends on an attacker being able to observe &lt;code&gt;Math.random()&lt;/code&gt; outputs and influence multipart content.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/advisories/GHSA-hmw2-7cc7-3qxx" rel="noopener noreferrer"&gt;&lt;code&gt;CVE-2026-12143&lt;/code&gt;&lt;/a&gt; concerns CRLF injection through untrusted multipart field names or filenames in affected &lt;code&gt;form-data&lt;/code&gt; versions.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/advisories/GHSA-72xf-g2v4-qvf3" rel="noopener noreferrer"&gt;&lt;code&gt;CVE-2023-26136&lt;/code&gt;&lt;/a&gt; is a &lt;code&gt;tough-cookie&lt;/code&gt; prototype-pollution issue, with a specific cookie-jar configuration precondition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are also &lt;code&gt;qs&lt;/code&gt; and &lt;code&gt;uuid&lt;/code&gt; advisories in the resolved tree. Their practical impact depends on the application's own parse/stringify flow or UUID API use. A dependency audit is a signal to investigate, not proof that a particular endpoint is exploitable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Just Translate Every Call to Axios?
&lt;/h2&gt;

&lt;p&gt;A direct rewrite changes more than syntax. Axios returns a promise and a response object with &lt;code&gt;data&lt;/code&gt;; &lt;code&gt;request&lt;/code&gt; commonly uses a callback and passes the body as a separate argument. The projects may also differ on redirects, streaming, cookie jars, timeout details, form serialization, and error handling. Those differences are where the regression work hides.&lt;/p&gt;

&lt;p&gt;For a large legacy codebase, the safer sequence is usually:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inventory the actual options and helper patterns in use.&lt;/li&gt;
&lt;li&gt;Add characterization tests around important request and response behavior.&lt;/li&gt;
&lt;li&gt;Replace the transport behind the current import name.&lt;/li&gt;
&lt;li&gt;Migrate unsupported edge cases separately, with explicit tests.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a gradual trial, npm supports an alias:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;request@npm:request-to-axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Existing &lt;code&gt;require('request')&lt;/code&gt; statements can continue resolving while the installed implementation comes from the wrapper. A representative callback call looks familiar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;request&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.test/items&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;json&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  A Compatibility Layer, Not a Security Guarantee
&lt;/h2&gt;

&lt;p&gt;The wrapper covers common callback/stream usage, method helpers, defaults, query strings, JSON, URL-encoded and multipart forms, immediate Basic/Bearer auth, redirects, a small in-memory cookie jar, TLS settings, and common transport options. It does &lt;strong&gt;not&lt;/strong&gt; implement OAuth/Hawk/AWS/HTTP signing, HAR import, digest retries, &lt;code&gt;multipart/related&lt;/code&gt;, or exact legacy redirect semantics. The cookie jar is deliberately limited and does not replace a full browser cookie implementation.&lt;/p&gt;

&lt;p&gt;That distinction matters. Migrating off an unmaintained client removes one set of risks; it does not make an application secure by itself. Review redirect destinations, validate user-controlled URLs, keep TLS verification enabled, and run &lt;code&gt;npm audit&lt;/code&gt; on the resulting dependency graph. Add tests for the options your service actually uses before deploying the alias.&lt;/p&gt;

&lt;p&gt;The package and its current compatibility notes are on &lt;a href="https://www.npmjs.com/package/request-to-axios" rel="noopener noreferrer"&gt;npm&lt;/a&gt; and &lt;a href="https://github.com/prithwirajbose/request-to-axios" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. If a legacy option is important to your migration, check the documented limits first and open an issue with a minimal example.&lt;/p&gt;

</description>
      <category>node</category>
      <category>security</category>
      <category>javascript</category>
      <category>npm</category>
    </item>
    <item>
      <title>Why Tensorflow.js based Weather Prediction Model is unable to predict correct weather</title>
      <dc:creator>Prithwiraj Bose</dc:creator>
      <pubDate>Mon, 27 May 2024 16:10:06 +0000</pubDate>
      <link>https://dev.to/sribasu/why-tensorflowjs-based-weather-prediction-model-is-unable-to-predict-correct-weather-1o5h</link>
      <guid>https://dev.to/sribasu/why-tensorflowjs-based-weather-prediction-model-is-unable-to-predict-correct-weather-1o5h</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://assets.dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/78536168/why-tensorflow-js-based-weather-prediction-model-is-unable-to-predict-correct-we" rel="noopener noreferrer"&gt;
            Why Tensorflow.js based Weather Prediction Model is unable to predict correct weather
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;May 26 '24&lt;/span&gt;
            &lt;span&gt;Comments: 2&lt;/span&gt;
            &lt;span&gt;Answers: 2&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/78536168/why-tensorflow-js-based-weather-prediction-model-is-unable-to-predict-correct-we" rel="noopener noreferrer"&gt;
        &lt;img src="https://assets.dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          2
        &lt;/div&gt;
        &lt;img src="https://assets.dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am learning tensorflow.js and this is perhaps the first full program I am trying to write. However I feel something is wrong. My model is not able to predict right Weather and always predicting 'Haze' no matter how I train it. Following is the sample NodeJS program I am…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/78536168/why-tensorflow-js-based-weather-prediction-model-is-unable-to-predict-correct-we" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Please help me solve the problem I am facing with tensorflow.js&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
