Find and fix your first Dependabot alert
Fork the Dependabot demo, enable alerts and security updates with gh, merge the hot-formula-parser lockfile PR, then add version updates.
What are we building and why?
We are running GitHub's Dependabot teaching drill on a fork of a demo app that already contains insecure dependencies. The outcome is a merged security-update pull request that closes the hot-formula-parser alert, plus version updates enabled so Dependabot can keep proposing newer releases.
GitHub's Finding and fixing your first dependency vulnerability page is pure github.com UI. You navigate to new2code/dependabot-demo, click Fork → Create fork, open Security and quality, enable Dependabot alerts (confirming the dependency graph popup), enable Dependabot security updates, open the Dependabot sidebar alert Command Injection in hot-formula-parser, read the fix summary (upgrade to 3.0.1 in javascript/package-lock.json), click Review security update, review Files changed, merge and confirm, then enable Dependabot version updates under Settings → Advanced Security.
When we drilled this at ZeroShot Studio, the highest-value click was Review security update: people finally saw Dependabot's diff before merging. After we banned hand-rolled REST enable scripts for this lesson, teaching accounts stopped getting stuck on inventing PUT endpoints that the learning page never shows. The demo is intentionally insecure and not deployed, so there is no production blast radius while you learn the tabs.
Related reading: How to Reuse Other People's Code in Your Projects, How to Store Your Secrets Safely, and How to Find and Fix Your First Code Vulnerability. Authority: About Dependabot alerts, About Dependabot security updates, and About Dependabot version updates.
"While using dependencies is perfectly normal, dependencies can contain code vulnerabilities, which would in turn make your project insecure."
That is GitHub's framing. My rule of thumb at ZeroLabs: enable alerts and security updates first, read the alert body (or ask Copilot Chat if the advisory is dense), merge only after Files changed looks like the expected version bump, then turn on version updates so you are not only reactive.
flowchart TD
Repo[Create dependabot-action from template] --> Enable[Enable Dependency Graph and Dependabot alerts]
Enable --> Trigger[Push commit with outdated dependency]
Trigger --> Alert[View alert in Security tab]
Alert --> Review[Review advisory severity and fix summary]
Review --> Update[Review automated Dependabot security PR]
Update --> Merge[Merge update and verify alert resolution]What are the required prerequisites?
Stay in the browser. The source page does not document gh repo fork, REST vulnerability-alerts, or gh pr merge for this exercise.
| Prerequisite Layer | Minimum | Production recommendation | Purpose in stack |
|---|---|---|---|
| GitHub account | Signed-in user who can fork | Same account will own the fork | Create dependabot-demo under your user |
| Demo upstream | new2code/dependabot-demo | Fresh fork; do not deploy it | Ships known vulnerable dependencies for practice |
| UI surfaces | Security and quality, Dependabot sidebar, Settings → Advanced Security | Latest github.com navigation labels | Enable features, read alerts, merge the fix PR |
| Optional helper | Copilot Chat | Use only to explain dense advisory text | Clarify vulnerability details if needed |
| Network | HTTPS to github.com | Stable session while Dependabot opens the PR | Fork, enable, review, merge |
How do you implement the step-by-step recipe?
Follow GitHub's sections in order. Every control below is a UI label from the learning page.
-
Fork the demo repository. Open
new2code/dependabot-demo. In the top right, click Fork. On the next page, click Create fork. You will not deploy this project; the insecure dependencies are safe for the exercise. -
Enable Dependabot alerts and security updates. In your fork's navigation bar, click Security and quality. In the Dependabot alerts row, click Enable Dependabot alerts. In the Dependabot section, next to Dependabot alerts, click Enable. In the popup about enabling the dependency graph, read the statement, then click Enable. Next to Dependabot security updates, click Enable so Dependabot can open pull requests that fix vulnerabilities automatically.
-
Open the Dependabot alert list and pick the teaching alert. Click Security and quality again if you left the page. In the side navigation, click Dependabot. Click the alert title Command Injection in hot-formula-parser to open details.
-
Read the alert the way GitHub structures it.
- Fix summary: Upgrading
hot-formula-parserto version 3.0.1 fixes one alert identified injavascript/package-lock.json. When a fix PR exists, use the Review security update button. - Vulnerability details: Package name, vulnerable versions, fixed version, and how the issue can be exploited. In this alert,
parseinhot-formula-parserdoes not properly validate user input before execution, which allows command injection. - Timeline: Starts with the timestamp Dependabot opened the alert; it gains a fix time after you merge.
Tip from the docs: if the advisory text is unclear, ask Copilot Chat to explain it.
- Fix summary: Upgrading
-
Apply the Dependabot security update. In the fix summary area, click Review security update. On the pull request, open Files changed and confirm Dependabot's version bump. Return via Conversation. At the bottom, click Merge pull request, then Confirm merge. When the PR merges, the linked Dependabot alert closes and the timeline records the fix time.
-
Enable Dependabot version updates for prevention. Open Settings on the fork. Under the Security section of the sidebar, click Advanced Security. Next to Dependabot version updates, click Enable. Dependabot can then open pull requests as new dependency versions ship, not only after a CVE alert.
How do you verify the deployment works?
| Check | Expected signal | If it fails |
|---|---|---|
| Fork | Your account owns a dependabot-demo fork | Re-run Fork → Create fork on the upstream demo |
| Alerts on | Dependabot alerts enabled; dependency graph accepted | Security and quality → Enable Dependabot alerts → Enable in popup |
| Security updates on | Dependabot security updates shows enabled | Click Enable next to Dependabot security updates |
| Alert visible | Dependabot sidebar lists Command Injection in hot-formula-parser | Wait for Dependabot to finish first analysis, then refresh |
| Fix merged | Security-update PR merged; alert closed; timeline shows fix | Review security update → Files changed → Merge → Confirm merge |
| Version updates on | Dependabot version updates enabled under Advanced Security | Settings → Advanced Security → Enable |
What are the common production failure modes?
- Enabling alerts but skipping security updates: Cause: stopping after the first Enable. Fix: also enable Dependabot security updates so the Review security update PR can appear.
- Merging without reading Files changed: Cause: trusting the button alone. Fix: open Files changed, confirm the
hot-formula-parserbump toward 3.0.1 in the lockfile, then merge. - Looking for alerts under Code instead of Security: Cause: old navigation habits. Fix: repository Security and quality → sidebar Dependabot.
- Leaving version updates off: Cause: treating the single merged alert as permanent safety. Fix: Settings → Advanced Security → enable Dependabot version updates.
- Rewriting the drill as
gh/REST: Cause: agent-oriented habits from other guides. Fix: this page's primary path is fork + Security tab + merge UI only.
FAQ
Is it safe to fork a repo that has known vulnerabilities? For this exercise, yes. GitHub states you will not deploy the demo, so there is no security risk in practicing on the fork.
What does the fix summary mean by upgrading to 3.0.1?
Dependabot identified that moving hot-formula-parser to 3.0.1 closes the alert tied to javascript/package-lock.json. The security-update PR applies that change for you.
Why enable both security updates and version updates? Security updates open PRs for known vulnerable dependencies. Version updates open PRs as new versions release, which helps you stay current before the next advisory.
Do I need the GitHub CLI? Not for this learning page. Every required action is a github.com control: Fork, Security and quality, Dependabot, Review security update, Merge, Settings → Advanced Security.
What should I do after the demo? GitHub's next step is to enable the same Dependabot features on your own projects so you can find, fix, and prevent dependency vulnerabilities outside the teaching fork.