trailmark-variant-neighborhood
ما الذي تفعله
تأخذ هذه المهارة ثغرة مؤكدة أو مشتبهًا بها واحدة، وتجد شيفرة ذات بنية مشابهة، مثل الدوال الشقيقة أو المستدعين المشتركين. وهي موجهة إلى باحثي الأمان الذين يبحثون عن نسخ أخرى من المشكلة نفسها.
متى تستخدمها
- ✓عندما تجد مشكلة أمنية واحدة وتريد معرفة هل تحمل شيفرة مشابهة الخلل نفسه.
- ✓عندما يعتمد خطأ على كيفية استدعاء الدوال لبعضها، وبحث النص البسيط سيفوّته.
- ✓عندما تريد تمرير المرشحين للمراجعة إلى خطوة تحليل المتغيرات أو كتابة قواعد Semgrep.
رابط المهارة
https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/trailmark-variant-neighborhood/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“وجدت خطأ مدخلًا غير مفحوص في هذه الدالة. ابحث عن شيفرة أخرى مبنية بالطريقة نفسها وقد تحمل الخطأ أيضًا.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تربط المهارة المشكلة بنقطة في الرسم البياني، ثم توسّع البحث إلى الدوال ذات الصلة والمستدعين المشتركين ونقاط المصب (sinks) وتنفيذات الواجهات، والشيفرة المشابهة. وتُرتَّب النتائج كمرشحين للمراجعة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Trailmark Variant Neighborhood
Expand one seed issue into graph-derived variant candidates. This skill generates review targets, not confirmed findings.
When to Use
- A finding is confirmed or plausible and variants may exist
- The vulnerable pattern depends on call context
- The issue involves a shared sink, source, validator, interface, override, trait, hook, handler, adapter, or critical type
- The next step is to seed
variant-analysis,semgrep-rule-creator,static-analysis, or manual review
When NOT to Use
- No seed issue exists. Use discovery or triage first.
- The pattern is purely syntactic and already obvious. Use
semgrep-rule-creatordirectly. - The question is exploit-chain composition across multiple findings. Use a composition workflow.
- The goal is remediation verification. Use a remediation-review workflow.
- The seed cannot be bound to a graph node.
Rationalizations to Reject
| Rationalization | Why It Is Wrong | Required Action |
|---|---|---|
| "Nearby code means variant" | Proximity is only a candidate reason | Rank it as a review target |
| "Only exact same names matter" | Variants often share sinks or preconditions, not names | Expand across callers, callees, interfaces, and types |
| "Every candidate is a finding" | This skill outputs candidates for review | Avoid vulnerability claims |
| "Unreachable candidates can be ignored completely" | They may become reachable after refactors | Rank lower or list as deferred |
| "Graph candidates replace semantic pattern work" | Graph structure finds locations, not root-cause semantics | Hand off to variant-analysis, Semgrep, CodeQL, or manual review |
Workflow
Variant Neighborhood Progress:
- [ ] Step 1: Normalize and bind the seed
- [ ] Step 2: Expand graph neighborhoods
- [ ] Step 3: Rank candidates
- [ ] Step 4: Extract variant pattern guidance
- [ ] Step 5: Emit handoff packet
Step 1: Normalize And Bind The Seed
Accept finding text, file/line, function name, or output from
trailmark-finding-triage. Bind the seed to a Trailmark node and record the
root cause in plain language.
If the seed has no concrete graph binding, stop before inventing variants.
Step 2: Expand Neighborhoods
Use the dimensions in references/neighborhood-patterns.md:
- shared callers
- shared callees and sinks
- entrypoint path neighbors
- interface, override, trait, and implementation siblings
- file or module cluster neighbors
- taint or privilege-boundary peers
- type and state-reference neighbors
Bound expansion to avoid candidate floods.
Step 3: Rank Candidates
Rank with references/ranking.md. Prioritize entrypoint-reachable, tainted, boundary-adjacent, high-blast-radius, shared sink, same-interface, and close-distance candidates. Penalize test, mock, generated, vendor, unreachable, and trusted-internal-only candidates.
Step 4: Extract Pattern Guidance
Summarize what should be searched for syntactically and what requires semantic review. Identify whether follow-up belongs in:
variant-analysissemgrep-rule-creatorstatic-analysiswith CodeQL or SARIF-producing tools- manual review
Step 5: Emit Handoff Packet
Use references/output-format.md. Include ranked candidates, inclusion reasons, exclusions, limitations, and the variant-analysis handoff.
Stop Conditions
- No graph binding exists
- Candidate count is too high and the root cause is underspecified
- Trailmark cannot analyze the target language
- The seed is only in test, generated, or vendor code and the user did not say that code is in scope
الأسئلة الشائعة
هل النتائج أخطاء مؤكدة؟
لا. النتائج مرشحة للمراجعة، وليست نتائج مؤكدة.
هل أحتاج إلى خطأ معروف للبدء؟
نعم. تحتاج إلى مشكلة بذرية واحدة، سواء كانت مؤكدة أو مشتبهًا بها.
أي المهارات تستطيع استخدام نتائجها بعد ذلك؟
يمكن أن تُستخدم المرشحات لتغذية تحليل المتغيرات، أو كتابة قواعد Semgrep، أو التحليل الثابت، أو خطوات المراجعة اليدوية.
التفاصيل
الوصف الأصلي من المؤلف
Expands one confirmed or suspected vulnerability into a Trailmark graph neighborhood of variant candidates by finding sibling functions, shared callers and callees, common sensitive sinks, common entrypoint paths, interface implementations, override relationships, type/reference neighbors, and structurally similar nodes. Use after one issue is found to seed variant-analysis, semgrep-rule-creator, static-analysis, or manual review with graph-derived candidate locations.
repo: trailofbits/skills
الشعبية
- نجوم GitHub
- 8.0k
- الترتيب
- #12736
- الترخيص
- CC-BY-SA-4.0
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
audit-context-building
8.0kيساعد وكيلك على فهم شيفرة غير مألوفة قبل مراجعة أمنية، عبر رسم ما تفترضه كل دالة وما تضمنه وما تعتمد عليه.
algorand-vulnerability-scanner
8.0kيساعد وكيلك على فحص عقود Algorand الذكية المكتوبة بـ TEAL أو PyTeal لاكتشاف 11 مشكلة أمنية شائعة، مثل هجمات إعادة المفاتيح والرسوم غير المفحوصة.
audit-prep-assistant
8.0kيساعد وكيلك على تجهيز الشيفرة لمراجعة أمنية خارجية، عبر التحليل الثابت وتغطية الاختبارات وحذف الشيفرة الميتة وتوثيق واضح.
cairo-vulnerability-scanner
8.0kيساعد وكيلك على فحص عقود Cairo الذكية على StarkNet لاكتشاف 6 مشكلات خطيرة، مثل فيض الحساب والرسائل بين الطبقات وإعادة تشغيل التوقيعات.
مهارات مشابهة
reverse-engineer-anything
422kيساعد وكيلك على فحص التطبيقات والحزم المنشورة من الداخل ليشرح الميزات ويقارن الإصدارات ويرشد إلى إعادة البناء، باستخدام أداة REA.
1password
394kيساعد وكيلك على إعداد واجهة سطر أوامر 1Password وتسجيل الدخول، وقراءة الأسرار أو حقنها دون طباعة قيمها في المحادثة.
healthcheck
394kيساعد وكيلك على تدقيق جهاز OpenClaw أو خادمه أمنيًا، مثل SSH والجدار الناري والتحديثات، ويقترح إصلاحات آمنة قابلة للتراجع.