<?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: Chirag Goel</title>
    <description>The latest articles on DEV Community by Chirag Goel (@engineerchirag).</description>
    <link>https://dev.to/engineerchirag</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F298209%2F51beeac4-bccc-47a4-b726-70906f154c56.jpg</url>
      <title>DEV Community: Chirag Goel</title>
      <link>https://dev.to/engineerchirag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/engineerchirag"/>
    <language>en</language>
    <item>
      <title>Master These 30+ JavaScript Questions to Level Up Your Interview Game</title>
      <dc:creator>Chirag Goel</dc:creator>
      <pubDate>Wed, 26 Feb 2025 15:01:16 +0000</pubDate>
      <link>https://dev.to/engineerchirag/master-these-30-javascript-questions-to-level-up-your-interview-game-2jma</link>
      <guid>https://dev.to/engineerchirag/master-these-30-javascript-questions-to-level-up-your-interview-game-2jma</guid>
      <description>&lt;p&gt;JavaScript is one of the most important programming languages for technical interviews, especially for front-end and full-stack roles. Mastering JavaScript interview questions helps you:&lt;/p&gt;

&lt;p&gt;✅ Demonstrate problem-solving skills and algorithmic thinking&lt;br&gt;
✅ Showcase deep knowledge of JavaScript fundamentals and advanced concepts&lt;br&gt;
✅ Improve your ability to write clean, optimized, and efficient code&lt;br&gt;
✅ Boost confidence in handling real-world coding challenges&lt;/p&gt;

&lt;p&gt;Below are 30+ JavaScript questions that frequently appear in interviews. Understanding and solving them will enhance your coding skills and improve your chances of landing your dream job.&lt;/p&gt;

&lt;p&gt;JavaScript Interview Questions You Must Master&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core JavaScript Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💡 Create a Curried Multiplication Function&lt;br&gt;
💡 Group Elements by Callback&lt;br&gt;
💡 Merge Identical API Calls&lt;br&gt;
💡 Custom Polyfill for document.getElementById&lt;br&gt;
💡 Store and Return Message&lt;br&gt;
💡 Memoization for Expensive Calculations&lt;br&gt;
💡 Last Card Loser&lt;br&gt;
💡 Create a Count Function&lt;br&gt;
💡 Two-Way Data Binding with Model&lt;br&gt;
💡 Flatten Array of Objects&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced JavaScript Techniques&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💡 Distribute Task Units&lt;br&gt;
💡 Throttle API Requests with Promises&lt;br&gt;
💡 Implement _.chunk()&lt;br&gt;
💡 Convert Hours to Minutes&lt;br&gt;
💡 Bind state.value to an HTMLInputElement&lt;br&gt;
💡 Polyfill for Promise.all&lt;br&gt;
💡 Implement LocalStorage with Expiry&lt;br&gt;
💡 Auto-Retry Promise on Rejection&lt;br&gt;
💡 Counting Layers in a Grid&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Structures &amp;amp; Algorithms&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💡 Implement Array.prototype.reduce()&lt;br&gt;
💡 Count Number of Parameters&lt;br&gt;
💡 Intersection of Two Sorted Arrays&lt;br&gt;
💡 Create an Incrementing Score Tracker&lt;br&gt;
💡 Multiply Using Anonymous Functions&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Take Your Coding Skills to the Next Level with KodeKarma&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Looking to sharpen your coding skills and get interview-ready? KodeKarma is your ultimate platform for practicing frontend coding challenges. With carefully curated problems, real-world scenarios, and personalized guidance, KodeKarma helps you:&lt;/p&gt;

&lt;p&gt;🔥 Improve problem-solving efficiency with hands-on coding challenges🔥 Learn from real-world scenarios tailored for frontend development🔥 Get insights and tips from experienced developers&lt;br&gt;
🔥 Track your progress and stay motivated&lt;br&gt;
🔥 Prepare smarter and faster for coding interviews&lt;/p&gt;

&lt;p&gt;Looking to take your coding skills to the next level? &lt;a href="https://www.kodekarma.dev/" rel="noopener noreferrer"&gt;kodekarma.dev&lt;/a&gt; is your go-to platform for practicing frontend coding challenges. With curated problems, real-world scenarios, and guidance tailored for all levels, KodeKarma helps you prepare smarter and faster. Start your journey to interview success today!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>It’s difficult to live with and without Git — Oh! Shit! Git!</title>
      <dc:creator>Chirag Goel</dc:creator>
      <pubDate>Sat, 04 Jan 2020 15:18:43 +0000</pubDate>
      <link>https://dev.to/engineerchirag/it-s-difficult-to-live-with-and-without-git-oh-shit-git-5f7a</link>
      <guid>https://dev.to/engineerchirag/it-s-difficult-to-live-with-and-without-git-oh-shit-git-5f7a</guid>
      <description>&lt;p&gt;Git is a &lt;a href="https://git-scm.com/about/free-and-open-source"&gt;free and open source&lt;/a&gt; distributed version control system designed to handle everything from small to very large projects with speed and efficiency.&lt;br&gt;
This standard definition tell you the power of git and most of us have seen it while using it our projects.&lt;/p&gt;

&lt;p&gt;But if anyone of you haven’t used it yet, so its a right time to get your hand dirty — &lt;a href="https://devdocs.io/git/"&gt;https://devdocs.io/git/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Imagining a life without you is something that is impossible, you make me complete and I want you to say you mean everything to me.-”&lt;br&gt;
 — Most of the developers using git&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article will mostly cover the challenges and the solution to our struggles with git. If below problems sounds familiar to you, then this article is for you -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You committed something and immediately realised I want to make one more small change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You accidentally committed something on another branch (say master)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nothing shows in diff command&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You want to squash multiple commits into one&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You did something terribly wrong and want to time travel your git life cycle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You wanted to know who the hell have written this code&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Git is hard: screwing up is easy, and figuring out how to fix your mistakes is &lt;em&gt;fucking impossible&lt;/em&gt;.&lt;br&gt;
 — mSingh&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I know most of above problems are very much familiar to you. So let’s dive into their solutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ELA0e4Ha--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2676/1%2A-nWh92VnaW3CUzMycHtvVQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ELA0e4Ha--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2676/1%2A-nWh92VnaW3CUzMycHtvVQ.png" alt="Recipes for getting out of a git mess (Chirag Goel)" width="880" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. You committed something and immediately realised I want to make one more small change.&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*# make your change*
**git add .** *# or add individual files*
**git commit --amend**
*# follow prompts to change or keep the commit message
# now your last commit contains that change! *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  2. Nothing shows in diff command
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**git diff --staged**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  3. You want to squash multiple commits into one
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*#This will squash last 3 commits into single commit*
**git reset --soft HEAD~3 &amp;amp;&amp;amp;
git commit**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  4. You did something terribly wrong and want to time travel your git life cycle
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**git reflog**
# you will see a list of every thing you've done in git, across all branches!
# each one has an index HEAD@{index}
# find the one before you broke everything
**git reset HEAD@{index}**
# magic time machine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  5. You need to change the message on last commit
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**git commit --amend**
# follow prompts to change the commit message
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  6. You wanted to know who the hell have written this code
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# last commit by on each line**
git blame -l &amp;lt;filename&amp;gt;**

# last commit by between lines in a file**
git log -L55,60:file.c**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  7. You accidentally committed something on another branch (say master)
&lt;/h3&gt;

&lt;p&gt;Solution by creating new branch —&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*# create a new branch from the current state of master*
**git branch -b some-new-branch-name**
*# checkout to master and remove the commit from the master branch
***git checkout master***
***git reset HEAD~ --hard**
**git checkout some-new-branch-name**
*# your commit lives in this branch now :)*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Solution using stash&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# undo the last commit, but leave the changes available
**git reset HEAD~ --soft**
**git stash**
# move to the correct branch
**git checkout name-of-the-correct-branch
git stash pop**
**git add .** # or add individual files
**git commit -m "your message here"**
# now your changes are on the correct branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Solution using cherry-pick&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# take that commit to another branch and remove it from master 
**git checkout name-of-the-correct-branch**
# grab the last commit to master
**git cherry-pick [master- SHA]**
# delete it from master
**git checkout master**
**git reset HEAD~ --hard**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The last and most important — &lt;a href="https://ohshitgit.msingh.com/fuck-this-noise-i-give-up"&gt;Fuck this noise, I give up.&lt;/a&gt;&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*&lt;em&gt;cd ..&lt;br&gt;
sudo rm -r giveup-git-repo-dir&lt;br&gt;
git clone &lt;a href="https://some.github.url/giveup-git-repo-dir.git"&gt;https://some.github.url/giveup-git-repo-dir.git&lt;/a&gt;&lt;br&gt;
cd giveup-git-repo-dir&lt;br&gt;
*&lt;/em&gt;# Delete the git repo and clone the fresh repo from remote origin&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Wrapping up&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Woo! That’s all about most popular git problems. Stay tuned to my future articles.&lt;/p&gt;

&lt;p&gt;Was this article helpful for you? Let me know in the comments below if you have any questions or thoughts! I’d love to hear them :)&lt;/p&gt;

&lt;p&gt;Thanks for reading. Did this article help you in any way? If I did, I hope you consider sharing it you might just help someone who felt the same way you did before reading the article. Thank you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Sharing makes you bigger than you are. The more you pour out, the more life will be able to pour in.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Setup your personal blogging website from dev.to in 2min</title>
      <dc:creator>Chirag Goel</dc:creator>
      <pubDate>Tue, 24 Dec 2019 17:47:56 +0000</pubDate>
      <link>https://dev.to/engineerchirag/setup-your-personal-blogging-website-from-dev-to-in-2min-200c</link>
      <guid>https://dev.to/engineerchirag/setup-your-personal-blogging-website-from-dev-to-in-2min-200c</guid>
      <description>&lt;p&gt;Most of us often like to learn and share our knowledge digitally through articles, videos, podcast, live sessions etc.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;— Articles are the simplest, easiest and impactful way of doing so.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Among many alternatives for readers like medium, hubPages, dev.to etc. Dev seems to be more popular among software developers. So in this article we will be talking about dev.to.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;dev.to (or just Dev) is a platform where software developers write articles, and take part in discussions and build their professional profile. It value supportive and constructive dialogue in the pursuit of great code and career growth of all members.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For whom this article is?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Do you write blogs on dev.to or planning to do so?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you want to setup your own identity(website) without investing much time in infra setup?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you believe in write once and use at multiple places?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;If above questions seems familiar to you, this article is for you.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the challenges we face in order to setup our own blog website?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;From where to get theme?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to build my website?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to update content of my website?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Where to host it?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to deploy it?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to keep it up to date with my public blogging profile (dev.to)?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How to maintain it?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Simplest solution to all above problems — &lt;a href="http://stackbit.com"&gt;**Stackbit&lt;/a&gt;&lt;/em&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Stackbit — Combine any Theme, Site Generator and CMS to use git hosting and Netlify for deployment without complicated integrations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So let’s start with your blogging website setup. Follow below steps to create your website before your Maggie is ready. Your 2min starts now-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open &lt;a href="https://app.stackbit.com/create?ref=devto"&gt;**Stackbit&lt;/a&gt; **and login.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your favourite theme.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ran2BU-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7640/1%2A4QxId1jLXaglK_l7fuGv3A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ran2BU-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7640/1%2A4QxId1jLXaglK_l7fuGv3A.png" alt="" width="880" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select any site generator. &lt;em&gt;Mine favourite is Gatsby.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XZeqq00o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7652/1%2A_IVTo2XwDPJOW0QcGgg8KQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XZeqq00o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7652/1%2A_IVTo2XwDPJOW0QcGgg8KQ.png" alt="" width="880" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Enter repo-name, repo with preferred name will be created in your Github account. Github will be used for hosting your website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect with your &lt;strong&gt;dev.to&lt;/strong&gt; and G*&lt;em&gt;ithub&lt;/em&gt;* account.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ob1W6RLM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7672/1%2ANVvKwDNrYrv3un5jTdy6PA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ob1W6RLM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7672/1%2ANVvKwDNrYrv3un5jTdy6PA.png" alt="" width="880" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kjdGhwyB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7656/1%2Apwel6dDC8UtOLj46BpAYzw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kjdGhwyB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/7656/1%2Apwel6dDC8UtOLj46BpAYzw.png" alt="" width="880" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on CREATE YOUR PROJECT it will ask you to signup on &lt;strong&gt;Netlify&lt;/strong&gt;, which will be used for deployment.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0MJqVusj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/6420/1%2AtM7DtzyPrtPLXGM5e1x_Pw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0MJqVusj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/6420/1%2AtM7DtzyPrtPLXGM5e1x_Pw.png" alt="" width="880" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;That’s all. Netlify is deploying your website. Meanwhile check if your Maggie is ready ;).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur21Ab5M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/6380/1%2AtfzaM9oAOtOTw437v7QKJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ur21Ab5M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/6380/1%2AtfzaM9oAOtOTw437v7QKJg.png" alt="" width="880" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Yuppie, your website is ready, click on ‘Visit Site’. For me my website was live before my Maggie. Do share your own experience in comments.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From now Netlify will take care of new post in dev.to or change in your repo on Github and will auto build &amp;amp; deploy it for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Woo! That’s all about &lt;strong&gt;setting up your personal blog from dev.to&lt;/strong&gt;, looking forward to hear about your Maggie challenge. Stay tuned to my future articles.&lt;/p&gt;

&lt;p&gt;Was this article helpful for you? Let me know in the comments below if you have any questions or thoughts! I’d love to hear them :)&lt;/p&gt;

&lt;p&gt;Thanks for reading. Did this article help you in any way? If I did, I hope you consider sharing it you might just help someone who felt the same way you did before reading the article. Thank you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;S&lt;/em&gt;&lt;em&gt;haring makes you bigger than you are. The more you pour out, the more life will be able to pour in.&lt;/em&gt;**&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tutorial</category>
    </item>
    <item>
      <title>Security Vulnerabilities in Web Apps</title>
      <dc:creator>Chirag Goel</dc:creator>
      <pubDate>Sun, 22 Dec 2019 19:49:34 +0000</pubDate>
      <link>https://dev.to/engineerchirag/security-vulnerabilities-in-web-apps-3ij5</link>
      <guid>https://dev.to/engineerchirag/security-vulnerabilities-in-web-apps-3ij5</guid>
      <description>&lt;p&gt;We will be talking about three degrees of security vulnerabilities that affect enterprise and consumer-oriented web applications: &lt;strong&gt;high-severity, medium-severity, and low-severity&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  I. High-Severity Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;High-severity vulnerabilities are security flaws that enable hackers to take complete control over a targeted application without having direct access to it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Cross-Site Scripting (XSS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SQL Injection&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server-side JavaScript Injection (SSJI)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remote Code Execution&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File Inclusion and Directory Traversal&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  II. Medium-Severity Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;Medium-severity flaws can partially compromise the confidentiality, integrity, and availability (CIA) of a website or web application. These flaws enable hackers to access business data and modify it to prevent your employees and customers from using it when needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Cross-Site Request Forgery&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Denial of Service (DoS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Security misconfiguration (Directory Listing)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transport Layer Security (TLS)/Secure Socket Layer (SSL)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  III. Low-Severity Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;Unlike high-severity and medium-severity vulnerabilities, low-severity flaws cannot be exploited over a network and require authorised access or direct user involvement to take control over a web app.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Insufficient protection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Failure to encrypt sensitive data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using components with known vulnerabilities&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2300%2F1%2ADpZs9j-tgrJ6HexFOzMvGQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2300%2F1%2ADpZs9j-tgrJ6HexFOzMvGQ.jpeg" alt="Security Vulnerabilities — (Chirag Goel)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Details of above Vulnerabilities:
&lt;/h2&gt;

&lt;p&gt;Let’s cover all of them one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Cross-Site Scripting (XSS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Cross-Site Scripting is a commonly used technique that allows running external JavaScript in the context of the attacked website. XSS allows getting access to full Web API. The simplest example of XSS attack implies that a hacker finds a vulnerable &lt;strong&gt;input&lt;/strong&gt; field on the page and creates a link that injects a snipper to another page. After the link is opened by a user, it’s up to the hacker what will be happened next.&lt;/p&gt;

&lt;p&gt;XSS is a high-rated security vulnerability since the attacker can get access to LocalStorage, SessionStorage, or cookies. That’s why it’s recommended not to store any sensitive data in these storages.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. SQL Injection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;SQL injection vulnerabilities exist for websites and apps powered by SQL database software( Structured Query Language). SQL software stores and organizes business data like customer records and payment info.&lt;/p&gt;

&lt;p&gt;As SQL databases require authentication, so SQL injection is implemented through app level.&lt;/p&gt;

&lt;p&gt;Thus, hackers who skip the authentication scheme of a web application to retrieve contents of an entire database. &lt;a href="https://d3eaqdewfg2crq.cloudfront.net/resources/acunetix-web-application-vulnerability-report-2016.pdf" rel="noopener noreferrer"&gt;SQL injections accounted for 64% of web app attacks&lt;/a&gt; that were registered through 2016.&lt;/p&gt;

&lt;p&gt;Injection flaws result from a classic failure to filter untrusted input. It can happen when you pass unfiltered data to the SQL server (SQL injection), to the browser (XSS), to the LDAP server (LDAP injection), or anywhere else. The problem here is that the attacker can inject commands to these entities, resulting in loss of data.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Server-side JavaScript Injection (SSJI)
&lt;/h3&gt;

&lt;p&gt;Server-side JavaScript Injection is one of the most widespread web app vulnerabilities on the web nowadays. It’s a pretty common thing when a developer accidentally introduces proneness into his web application by simple misconfiguration. For example, the **eval **function can be pretty open for attacks and can be exploited with ease.&lt;/p&gt;

&lt;p&gt;You should avoid the use of the &lt;strong&gt;eval&lt;/strong&gt; function to decrease the risk of such vulnerabilities. It’s used mostly for speed benefits, but it can compile and execute any JavaScript code which significantly increases the risks.&lt;/p&gt;

&lt;p&gt;If you use the concatenation of string of unsanctioned dynamic user input, be prepared to meet some unpleasant consequences.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Remote Code Execution
&lt;/h3&gt;

&lt;p&gt;Remote code execution allows hackers to trigger code execution over the internet.&lt;/p&gt;

&lt;p&gt;These attacks typically originate from one of your employees who clicks on an email link to a 3rd-party website. That website exploits the vulnerabilities of a web browser or the operating system (OS) running on your corporate computers and infects them with malware.&lt;/p&gt;

&lt;p&gt;A hacker can then manipulate the malicious program over the Internet to access sensitive data or lock the computers and demand ransom. Ransomware attacks, for example, &lt;a href="http://www.newsweek.com/ransomware-attacks-rise-250-2017-us-wannacry-614034" rel="noopener noreferrer"&gt;grew by 250% last year(link is external)&lt;/a&gt; and caused over $5 billion in damage.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. File Inclusion and Directory Traversal
&lt;/h3&gt;

&lt;p&gt;These vulnerabilities allow intruders to read directories and files outside the root directory, the top directory of a web app file system. During a file inclusion attack, access to any data stored “above” the root directory, for example, other websites’ directories, are inaccessible to users but are accessible to hackers.&lt;/p&gt;

&lt;p&gt;Eg. &lt;a href="http://192.168.80.134/dvwa/vulnerabilities/fi/?page=../../../../../../etc/passwd" rel="noopener noreferrer"&gt;http://192.168.80.134/dvwa/vulnerabilities/fi/?page=../../../../../../etc/passwd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The “../” characters used in the example above represent a directory traversal. The number of “../” sequences depends on the configuration and location of the target web server on the victim machine. Some experimentation may be required.&lt;/p&gt;

&lt;p&gt;We can see that the contents of /etc/passwd are displayed on the screen. A lot of useful information about the host can be obtained this way.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Cross-Site Request Forgery
&lt;/h3&gt;

&lt;p&gt;CSRF is an attack that exploits the mechanism of sending HTTP requests from the browser. If a user’s PC stores some cookies from a particular website, these cookies will be sent with the request, and it doesn’t matter who starts a given request. Thus, if you let things slide and don’t defend your web app against CSRF, a hacker can steal the accounts of your users.&lt;/p&gt;

&lt;p&gt;In the case of CSRF, a 3rd party site issues requests to the target site (e.g., your bank) using your browser with your cookies / session. If you are logged in on one tab on your bank’s homepage, for example, and they are vulnerable to this attack, another tab can make your browser misuse its credentials on the attacker’s behalf, resulting in the confused deputy problem. The deputy is the browser that misuses its authority (session cookies) to do something the attacker instructs it to do.&lt;/p&gt;

&lt;p&gt;Consider this example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Attacker Bot wants to lighten target ram’s PayTm wallet by transfering some of his money to her. PayTm bank is vulnerable to CSRF. To send money, Ram has to access the following URL:&lt;br&gt;
 &lt;a href="http://example.com/app/transferFunds?amount=1500&amp;amp;destinationAccount=4673243243" rel="noopener noreferrer"&gt;http://example.com/app/transferFunds?amount=150000&amp;amp;destinationAccountNumber=4673243243&lt;/a&gt;&lt;br&gt;
 After this URL is opened, a success page is presented to Ram, and the transfer is done. Bot also knows, that Ram frequently visits a site under her control at &lt;a href="https://medium.com/@engineerchirag" rel="noopener noreferrer"&gt;https://medium.com/@engineerchirag&lt;/a&gt;, where she places the following snippet:&lt;br&gt;
 &lt;em&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fexample.com%2Fapp%2FtransferFunds%3Famount%3D1500%26destinationAccountNumber%3D4673243243" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fexample.com%2Fapp%2FtransferFunds%3Famount%3D1500%26destinationAccountNumber%3D4673243243"&gt;&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
 Upon visiting Bot’s website, Ram’s browser thinks that Bot links to an image, and automatically issues an HTTP GET request to fetch the “picture”, but this actually instructs Ram’s bank to transfer $150000 to Alice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Incidentally, in addition to demonstrating the CSRF vulnerability, this example also demonstrates altering the server state with an idempotent HTTP GET request which is itself a serious vulnerability. HTTP GET requests &lt;em&gt;must&lt;/em&gt; be &lt;a href="https://en.wikipedia.org/wiki/Idempotence" rel="noopener noreferrer"&gt;idempotent&lt;/a&gt; (safe), meaning that they cannot alter the resource which is accessed. Never, ever, ever use idempotent methods to change the server state.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Denial of Service (DoS)
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;A distributed denial-of-service (DDoS) attack is a malicious attempt to disrupt normal traffic of a targeted server, service or network by overwhelming the target or its surrounding infrastructure with a flood of Internet traffic.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;DDoS attacks are popular because of their simplicity. During a DDoS attack, hackers basically generate a very large number of requests to a server in order to overwhelm it. The main purpose of these kind of attacks is to prevent legitimate users from accessing the server. The attack can be initiated through any individual system or group of systems or crawlers and can use any mechanism to flood servers with huge amount of information and choke it.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Security misconfiguration (Directory Listing)
&lt;/h3&gt;

&lt;p&gt;In my experience, web servers and applications that have been misconfigured are way more common than those that have been configured properly. Perhaps this because there is no shortage of ways to screw up. Some examples:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Running the application with debug enabled in production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Having directory listing enabled on the server, which leaks valuable information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Running outdated software (think WordPress plugins, old PhpMyAdmin).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Having unnecessary services running on the machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not changing default keys and passwords. (Happens way more frequently than you’d believe!)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Revealing error handling information to the attackers, such as stack traces.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  9. Transport Layer Security (TLS)/Secure Socket Layer (SSL)
&lt;/h3&gt;

&lt;p&gt;The SSL and TLS protocols enable two parties to identify and authenticate each other and communicate with confidentiality and data integrity.&lt;/p&gt;

&lt;p&gt;Vulnerabilities that allow intruders to access data transferred between client and server.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. Failure to encrypt sensitive data.
&lt;/h3&gt;

&lt;p&gt;This web security vulnerability is about crypto and resource protection. &lt;em&gt;Sensitive data should be encrypted at all times, including in transit and at rest. No exceptions.&lt;/em&gt; Credit card information and user passwords should &lt;em&gt;never&lt;/em&gt; travel or be stored unencrypted, and passwords should always be hashed. Obviously the crypto/hashing algorithm must not be a weak one — when in doubt, web security standards recommend &lt;a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="noopener noreferrer"&gt;AES (256 bits and up)&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/RSA_numbers#RSA-2048" rel="noopener noreferrer"&gt;RSA (2048 bits and up)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And while it goes without saying that session IDs and sensitive data should not be traveling in the URLs and sensitive cookies should have the secure flag on, this is very important and cannot be over-emphasized.&lt;/p&gt;

&lt;h3&gt;
  
  
  11. Insufficient protection
&lt;/h3&gt;

&lt;p&gt;This is simply an authorization failure. It means that when a function is called on the server, proper authorization was not performed. A lot of times, developers rely on the fact that the server side generated the UI and they think that the functionality that is not supplied by the server cannot be accessed by the client. It is not as simple as that, as an attacker can always forge requests to the “hidden” functionality and will not be deterred by the fact that the UI doesn’t make this functionality easily accessible. Imagine there’s an /admin panel, and the button is only present in the UI if the user is actually an admin. Nothing keeps an attacker from discovering this functionality and misusing it if authorization is missing.&lt;/p&gt;

&lt;h3&gt;
  
  
  12: Using components with known vulnerabilities
&lt;/h3&gt;

&lt;p&gt;The title says it all. I’d again classify this as more of a maintenance/deployment issue. Before incorporating new code, do some research, possibly some auditing. Using code that you got from a random person on &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or some forum might be very convenient, but is not without risk of serious web security vulnerability.&lt;/p&gt;

&lt;p&gt;I have seen many instances, for example, where sites got &lt;a href="https://en.wikipedia.org/wiki/Owned" rel="noopener noreferrer"&gt;owned&lt;/a&gt; (i.e., where an outsider gains administrative access to a system), not because the programmers were stupid, but because a 3rd party software remained unpatched for years in production. This is happening all the time with WordPress plugins for example. If you think they will not find your hidden phpmyadmin installation, let me introduce you to dirbuster.&lt;/p&gt;

&lt;p&gt;The lesson here is that software development does not end when the application is deployed. There has to be documentation, tests, and plans on how to maintain and keep it updated, especially if it contains 3rd party or open source components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ALLdSZyFNBDA31ibaB0KWeQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ALLdSZyFNBDA31ibaB0KWeQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prevention over above Vulnerabilities:
&lt;/h2&gt;

&lt;p&gt;Hold on, let’s wait for my next article. Stay tuned &lt;a href="https://medium.com/@engineerchirag" rel="noopener noreferrer"&gt;@engineerchirag&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Woo! That’s all about most popular security concern related to web apps. In my next article we will discuss all about it’s prevention and cool techniques.&lt;/p&gt;

&lt;p&gt;Was this article helpful for you? Let me know in the comments below if you have any questions or thoughts! I’d love to hear them :)&lt;/p&gt;

&lt;p&gt;Thanks for reading. Did this article help you in any way? If I did, I hope you consider sharing it you might just help someone who felt the same way you did before reading the article. Thank you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Sharing makes you bigger than you are. The more you pour out, the more life will be able to pour in.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>javascript</category>
      <category>security</category>
    </item>
  </channel>
</rss>
