Zum Hauptinhalt springen
LIVE
CVSS 7.4CVE-2026-138376 | AsyncSSH 1.13.1 before 2.24.2 contains an improper authentication vulnerability in SSHConnection._match_known_hosts that accumulates trusted client host keys across host-based authentication attempts on one connection. With trust_client_host enabled, attackers holding one known client host's private key can retry naming another known host and log in as users authorized only from that host.CVSS 7.6CVE-2026-138377 | AsyncSSH 1.13.1 before 2.24.2 contains an improper certificate validation vulnerability that allows remote clients to authenticate as users by abusing X.509 certificates matched in known_client_hosts. Attackers can make a failed host-based authentication attempt with any host key, adding host-only CA certificates to the trust anchors, then authenticate using user certificates issued under those CAs.CVSS 9.1CVE-2026-138378 | react-native-pure-jwt before 3.1.1 on Android contains a signature verification bypass vulnerability that allows unauthenticated attackers to forge tokens because RNPureJwtModule decode() calls JJWT parse() without algorithm pinning. Attackers can craft a token with header alg none and an empty signature to have arbitrary claims accepted as verified, forging identities or roles.CVSS 6.9CVE-2026-138379 | flare-redact before 1.13.1 contains a redaction bypass vulnerability that leaks secrets because the redact() object walker masks sensitive keys only when values are strings. Numbers, objects, arrays and binary data under keys such as password, cvv, pin, cookie or authorization pass through unchanged, exposing secrets in clear text to logger, Sentry, gateway and Fluent Bit sinks.CVSS 6.9CVE-2026-138380 | MediaInfoLib before 26.10 contains a heap-based buffer over-read vulnerability in File_Ogg::Data_Parse() that allows attackers to read beyond heap buffers via crafted Ogg segment sizes. Attackers can supply an Ogg file whose segment sizes exceed the page payload, wrapping the unsigned offset check and causing memcpy over-reads that crash the process or leak heap memory.CVSS 6.9CVE-2026-138381 | GNU LibreDWG 0.14 before 0.15 contains a heap use-after-free vulnerability in in_dxf.c new_object() where the OLE2FRAME oleclient pointer references freed memory after DXF import. Attackers can supply a DXF file with an OLE2FRAME entity to crash dxfwrite or similar applications and leak freed heap contents into exported output.CVSS 10.0CVE-2026-138227 | A vulnerability was found in D-Link R95 1.04B04Beta. This affects the function SetTimeSettings of the file /bin/ssi of the component DHMAPI. Performing a manipulation of the argument TZLocation results in os command injection. Remote exploitation of the attack is possible. The exploit has been made public and could be used.CVSS 10.0CVE-2026-138226 | A vulnerability has been found in D-Link R95 1.04B04Beta. Affected by this issue is the function SetSecureDNSSettings of the file /bin/ssi of the component DHMAPI SOAP interface. Such manipulation of the argument URI leads to os command injection. The attack may be launched remotely. The exploit has been disclosed to the public and may be used.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

10 Cursor Rules Every Developer Should Steal (.mdc)

I used to think AI coding assistants plateaued because the models weren't good enough. Then I watched a teammate's Cursor produce cleaner code than mine on the…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 7 Min. Lesezeit
Quelle: dev.to
Rubrik: Secure Programming

I used to think AI coding assistants plateaued because the models weren't good enough. Then I watched a teammate's Cursor produce cleaner code than mine on the same task, with the same model. The difference was his .cursor/rules/ folder. His assistant had a contract; mine was improvising.



A good Cursor rule isn't a motivational poster ("write clean code"). It's a specific, enforceable check scoped to when it matters. Below are ten rules I've stolen, refined, and now copy into every repo. Steal the ones that fit your stack. Each is a real .mdc file you can paste into .cursor/rules/.






Quick refresher on .mdc frontmatter



Cursor's Project Rules live in .cursor/rules/*.mdc. Three frontmatter fields decide when a rule loads:





  • alwaysApply: true — in context on every request. Keep these short and universal.


  • globs: "**/*.tsx" — auto-attaches only when a matching file is touched.

  • Neither set — Cursor pulls it in when the description looks relevant.



Scoping is the whole point. Ten rules loaded on every request dilute the context until the model ignores all of them. Ten scoped rules stay sharp because only the relevant two or three are ever present at once.






1. The non-negotiable global rule



This is the only one I set to alwaysApply: true. Everything in it is a check the model can apply to a diff, not an aspiration.




---
description: "Global engineering guardrails — always apply"
globs:
alwaysApply: true
---

- Validate and type all external input (request bodies, query params, env) at the boundary.
- No secrets in code. Read from env. Never log tokens, passwords, or full PII.
- Functions that can fail return a typed error or throw — never return null silently.
- When you change a signature, update every caller in the same edit.
- Prefer deleting code over adding a flag. The best fix removes complexity.









2. Kill any before it spreads (TypeScript)



Left alone, Cursor reaches for any constantly — it's the path of least resistance. This glob-scoped rule forces it to think about the real type.




---
description: TypeScript type-safety rules
globs: "**/*.ts, **/*.tsx"
alwaysApply: false
---

- No `any`. Use `unknown` + a narrow, or define the type. If truly stuck, add `// TODO: type` with a reason.
- Components are typed function components with an explicit props interface. No `React.FC`.
- Exported functions have explicit return types. No relying on inference at module boundaries.
- Prefer discriminated unions over optional-everything objects.









3. SQL safety, loaded on demand



No alwaysApply — it eats no context on your CSS work, but the description makes Cursor pull it in the moment you write a query.




---
description: Database and SQL safety — apply when writing queries or migrations
globs:
alwaysApply: false
---

- Always use parameterized queries / prepared statements. Never interpolate input into SQL.
- Any query that can return many rows is paginated or bounded with LIMIT.
- Watch for N+1: fetching a list then querying per item is a bug, not a style choice.
- Migrations are reversible and never run automatically — generate the file, let a human apply it.
- Select named columns, not `SELECT *`, in application queries.









4. Tests that target edges, not happy paths






---
description: Test-writing conventions — apply when adding or editing tests
globs: "**/*.test.*, **/*.spec.*"
alwaysApply: false
---

- Cover the edge cases first: empty input, null, boundary values, duplicate, and the error path.
- One behavior per test. The test name states the expected behavior, not the function name.
- No tests against private internals — test the public contract so refactors don't break them.
- Don't mock what you don't own without a thin wrapper around it.






The "edge cases first" line is what changes the output. Without it, Cursor writes the one test that proves the function runs and stops.






5. Commit messages a human can scan






---
description: Git commit message format
globs:
alwaysApply: false
---

- Use Conventional Commits: type(scope): subject. Types: feat, fix, refactor, test, docs, chore.
- Subject is imperative and under 60 chars: "fix: handle empty cart on checkout".
- Body explains *why*, not *what* — the diff already shows what.
- One logical change per commit. Don't bundle a refactor with a feature.









6. Accessibility, scoped to the frontend






---
description: Accessibility rules for UI
globs: "**/*.tsx, **/*.jsx, **/*.vue"
alwaysApply: false
---

- Every interactive element is keyboard-reachable and has an accessible name (label, aria-label, or text).
- Images have alt text; decorative images use alt="".
- Don't rely on color alone to convey state — pair it with text or an icon.
- Focus is visible and never trapped. Modals return focus to the trigger on close.









7. Error handling that surfaces, not swallows






---
description: Error handling
globs:
alwaysApply: false
---

- Never catch an error just to log it and continue — either handle it meaningfully or rethrow.
- Error messages include enough context to debug without a repro (id, operation, input shape).
- User-facing errors are friendly; internal errors keep the stack. Never leak internals to the client.
- No empty catch blocks. Ever.









8. Comments that explain "why"






---
description: Comment discipline
globs:
alwaysApply: false
---

- Comment *why*, not *what*. If a comment restates the code, delete it and rename instead.
- Flag non-obvious decisions, workarounds, and "do not change this because…" with a reason.
- No commented-out code in commits. That's what git history is for.









9. Dependency restraint






---
description: Dependency policy
globs:
alwaysApply: false
---

- Don't add a dependency to solve what 15 lines of code can. State the tradeoff if you do add one.
- Prefer the platform/standard library before reaching for a package.
- No new dependency without checking it's maintained (recent commits) and has no known critical CVEs.









10. The "stay in scope" rule



The one that saves the most cleanup time. Cursor loves to "helpfully" refactor three files you didn't ask about.




---
description: Scope discipline — always apply
globs:
alwaysApply: true
---

- Change only what the task requires. Don't reformat or refactor unrelated code in the same edit.
- If you spot an unrelated bug, mention it — don't fix it without asking.
- Keep diffs reviewable. A 400-line diff for a 2-line fix is a failure.









How to actually adopt these



Don't paste all ten today — you'll dilute the context and burn out maintaining them. Start with three: rule #1 (global guardrails), one stack rule (#2 if you're on TypeScript), and rule #10 (scope discipline). Live with those for a week. Add another only when you catch Cursor making the same mistake twice. A rule earns its place by preventing a real, repeated error — not by sounding good in a blog post.






If you'd rather start from a tuned set



Curating and maintaining a rule library is its own small project. If you want a head start, I packaged my full tuned collection as the Cursor AI Power Pack — a set of ready-to-drop .mdc rules organized by stack and concern, plus prompt recipes and a START HERE guide so you know which rule to enable when. It's the same scoped, anti-fluff philosophy as the ten above, just done for you.



But you don't need it to get value here. Copy rules #1 and #10 into your repo right now — those two alone will make your next Cursor session noticeably tighter.



Which rule does your team enforce that I left off this list? Drop it in the comments — I'm always hunting for ones worth stealing.

Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Gäste-Hinweise werden kurz redaktionell geprüft und danach hier angezeigt.

Community-Hinweise zur Meldung

0 freigegeben
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:

💬 Community discussion & comments

🌐 Join the main chat

Start the discussion in the Social Chat broadcast stream or submit an expert contribution via the supplement form above.

Community Rating & Social Proof
⭐ Reader Rating
–
Ø / 5.0
No reader ratings yet
Was this article helpful?
0
Submit your rating
Detailed rating (optional)
Content & Quality
Source & Credibility
Freshness
Security Briefing Free · 1-Click Unsubscribe

Intelligence Digest — free

The top security news daily · unsubscribe anytime

Related story clusters & sources (vector AI)

6 Cluster
25 sources
CVE-2026-135550 | Mozilla Firefox Web Codecs memory corruption (Nessus ID 388625)
VulDB Updates 1 hour ago
24 more sources
VulDB Updates1 hour agoCVE-2026-135551 | Mozilla Firefox up to 153.7/160 Layout use after free (Nessus ID 388625) VulDB Updates1 hour agoCVE-2026-135552 | Mozilla Firefox up to 115.45/153.7/160 Canvas2D use after free (Nessus ID 388625) VulDB Updates1 hour agoCVE-2026-135554 | Mozilla Firefox up to 115.45/153.7/160 Navigation use after free (Nessus ID 388625) VulDB Updates1 hour agoCVE-2026-135556 | Mozilla Firefox up to 115.45/153.7/160 JIT memory corruption (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135540 | Mozilla Firefox up to 115.45/153.7/160 JIT memory corruption (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135539 | Mozilla Firefox up to 115.45/153.7/160 CSS Object Model use after free (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135542 | Mozilla Firefox up to 115.45/153.7/160 Layout buffer overflow (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135541 | Mozilla Firefox up to 115.45/153.7/160 XSLT use after free (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135544 | Mozilla Firefox up to 115.45/153.7/160 Navigation memory corruption (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135545 | Mozilla Firefox up to 153.7/160 Editor memory corruption (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135543 | Mozilla Firefox up to 115.45/153.7/160 Networking memory corruption (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135547 | Mozilla Firefox up to 115.45/153.7/160 Networking sandbox (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135549 | Mozilla Firefox up to 115.45/153.7/160 XSLT use after free (Nessus ID 388625) VulDB Updates3 hours agoCVE-2026-135548 | Mozilla Firefox up to 115.45/153.7/160 Layout use after free (Nessus ID 388625) VulDB Updates4 hours agoCVE-2026-135533 | Mozilla Firefox up to 115.45/153.7/160 Layout Tables off-by-one (Nessus ID 388625) VulDB Updates4 hours agoCVE-2026-135536 | Mozilla Firefox up to 115.45/153.7/160 DOM Editor uninitialized pointer (Nessus ID 388625) VulDB Updates4 hours agoCVE-2026-135535 | Mozilla Firefox up to 115.45/153.7/160 Skia input validation (Nessus ID 388625) VulDB Updates4 hours agoCVE-2026-135537 | Mozilla Firefox up to 115.45/153.7/160 Layout Text/Fonts out-of-bounds (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135525 | Mozilla Firefox up to 115.45/153.7/160 WebRender use after free (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135526 | Mozilla Firefox up to 115.45/153.7/160 Networking use after free (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135527 | Mozilla Firefox up to 115.45/153.7/160 DOM/HTML use after free (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135528 | Mozilla Firefox up to 153.7/160 HTTP race condition (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135530 | Mozilla Firefox up to 115.45/153.7/160 HTTP sandbox (Nessus ID 388625) VulDB Updates5 hours agoCVE-2026-135529 | Mozilla Firefox up to 153.7/160 Text sandbox (Nessus ID 388625)
17 sources
Apple Cyber Monday Deals (2026): AirPods, iPads, MacBooks, and More
WIRED 16 min. ago
16 more sources
The Mac Observer24 min. agoAqara W200 thermostat is $119.99 for Cyber Monday, $40 off and Apple Home ready Latest from TechRadar42 min. agoCyber Monday mini PC deals 2026 live — top tiny desktops from GMKtec, Geekom, Minisforum, and more as the Black Friday sale continues The Mac Observer49 min. agoSonos Beam Gen 2 is $339 for Cyber Monday, $160 off and $359 under two HomePods The Mac Observer1 hour agoMagic Mouse in black drops to $79.99 for Cyber Monday, $19 under Apple’s $99 The Mac Observer1 hour agoGarmin fenix 8 47mm drops $250 to $749.99 for Cyber Monday, $49 under Ultra 4 Latest from TechRadar2 hours agoI've been waiting for a better deal on the Philips LatteGo 4400 — and Amazon has delivered a record-low price for Cyber Monday Latest from TechRadar2 hours agoLooking to get a last-minute gaming gift before Cyber Monday is over? WIRED3 hours agoLast Call for Black Friday iPad Deals (2026): Save Up to $100 Latest from Windows Central3 hours agoWhy I bought a handheld over a gaming laptop on Cyber Monday Latest from TechRadar3 hours agoI found the most capable PC under $300 for Cyber Monday — Origimagic's C7 Windows 11 Pro machine packs dual Thunderbolt 4, 2.5Gb LAN, a Core 3 100U, 16GB of RAM, and a 512GB SSD OS X Daily3 hours agoCyber Monday Deals: $300 Off 16″ PROLED MacBook Pro, $100 Off AirPods Pro 3, $100 Off iPad Air, & More Latest from TechRadar4 hours agoCyber Monday home office deals 2026 live — our top workspace picks from FlexiSpot, Dell, Anker, Logitech and more as Black Friday sale rolls on Latest from TechRadar4 hours agoThe best Cyber Monday deals in the UK in 2026: top picks from Amazon, Argos, Ninja, Lego and more Latest from TechRadar4 hours agoBlack Friday laptop deals 2026: the huge savings on MacBooks, Chromebooks and Windows 11 laptops still available from Apple, Dell, HP and many more Latest from TechRadar4 hours agoCyber Monday Australia laptop deals for 2026: score up to 52% off Lenovo, Apple, Dell, HP and more Latest from TechRadar4 hours agoAmazon Australia Cyber Monday deals
12 sources
CVE-2026-116159 | ImageMagick up to 6.9.13-57/7.1.2-32 CDL Option memory leak (Nessus ID 388637)
VulDB Updates 1 hour ago
11 more sources
Similar posts
🔍 Verwandte News

Auch interessante Nachrichten 10 Cursor Rules Every Developer Should Steal (.mdc)

Thematisch verwandte Begriffe: Cursor, Rules, Every, Developer · 6 Treffer

Laden...

Loading posts ...

Laden...

Loading videos ...

Laden...

Loading posts ...

Laden...

Loading videos ...

Laden...

Loading posts ...

Laden...

Loading videos ...

Laden...

Loading posts ...

Laden...

Loading videos ...

💬 Loading comments…
Pull to refresh
Widgets & topics
Loading widgets…
Next post