agentleFS
reaatechreaatech/mcp-changelog/skills/security-audit/SKILL.md

security-audit

Skill0 starsChanged 3 months agoMITView on GitHub

The security-audit skill provides guidelines for ensuring mcp-changelog is secure against common vulnerabilities including code injection, path traversal, supply chain attacks, and data exposure.

  • Deletes or force-pushes

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use asset-spec, create-stories and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lilangMaxSkill

    asset-spec

    Generate per-asset visual specifications and AI generation prompts from GDDs, level docs, or character profiles. Produces structured spec files and updates the master asset manifest. Run after art bible and GDD/level design are approved, before production begins.

    Also in 12 projects that use this

  • lilangMaxSkill

    create-stories

    Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.

    Also in 14 projects that use this

  • adybaSkill

    team-coordination

    Agent Teams orchestration patterns for multi-agent SAFe workflows. Use when spawning agent teams, coordinating teammates, enforcing quality gates via task dependencies, or orchestrating the 11-agent SAFe pipeline. Covers team creation, messaging, shared task lists, and SAFe gate enforcement. Do NOT use for single-agent or simple subagent workflows.

    Also in 5 projects that use this

  • nicepkgSkill

    community-led-growth

    Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.

    Also in 5 projects that use this

  • nicepkgSkill

    ph-community-outreach

    Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.

    Also in 5 projects that use this

  • +5 more from lilangMax
  • +2 more from nicepkg

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use lockfile for reproducible builds

    line 23

“Common” is measured: kept by at least 6 in 10 of the 174 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Audit Skill

Purpose

The security-audit skill provides guidelines for ensuring mcp-changelog is secure against common vulnerabilities including code injection, path traversal, supply chain attacks, and data exposure.

Capabilities

1. Input Validation

  • Validate all git refs before use
  • Sanitize schema file content
  • Validate configuration files
  • Prevent path traversal attacks

2. Secure Git Operations

  • Prevent command injection via ref names
  • Validate git repository paths
  • Handle malicious git hooks
  • Secure handling of remote repositories

3. Supply Chain Security

  • Verify dependency integrity
  • Use lockfile for reproducible builds
  • Audit dependencies for vulnerabilities
  • Secure GitHub Action distribution

Usage Examples

Input Validation

import { z } from 'zod';

// Validate git ref format
const gitRefSchema = z.string()
  .min(1, 'Ref cannot be empty')
  .max(255, 'Ref too long')
  .regex(/^[a-zA-Z0-9_./-]+$/, 'Invalid ref format')
  .refine(ref => !ref.includes('..') || ref.match(/^\w+\.\.\w+$/), {
    message: 'Invalid range format'
  });

function validateGitRef(input: string): string {
  return gitRefSchema.parse(input);
}

// Validate schema path
const pathSchema = z.string()
  .min(1)
  .max(500)
  .refine(path => !path.includes('..'), {
    message: 'Path traversal not allowed'
  })
  .refine(path => !path.startsWith('/'), {
    message: 'Absolute paths not allowed'
  });

function validateSchemaPath(input: string): string {
  return pathSchema.parse(input);
}

Secure Git Operations

// Good: Validate ref before passing to git
async function safeResolveRef(ref: string, repoPath: string): Promise<string> {
  // Validate format first
  const validated = validateGitRef(ref);

  // Use git's built-in validation
  try {
    const { stdout } = await execa('git', ['-C', repoPath, 'rev-parse', '--verify', validated]);
    return stdout.trim();
  } catch (error) {
    throw new GitRefNotFoundError(validated);
  }
}

// Bad: No validation
async function unsafeResolveRef(ref: string, repoPath: string): Promise<string> {
  const { stdout } = await execa('git', ['-C', repoPath, 'rev-parse', ref]);
  return stdout.trim();
}

Secure File Reading

import { realpath } from 'fs/promises';
import { join, normalize } from 'path';

async function safeReadFile(basePath: string, userPath: string): Promise<string> {
  // Resolve and validate path
  const resolved = normalize(join(basePath, userPath));
  const realBase = await realpath(basePath);
  const realResolved = await realpath(resolved);

  // Ensure resolved path is within base path
  if (!realResolved.startsWith(realBase + '/')) {
    throw new SecurityError('Path traversal detected');
  }

  return readFile(realResolved, 'utf-8');
}

Configuration Validation

import { z } from 'zod';

const configSchema = z.object({
  schema: z.object({
    paths: z.array(z.string().max(500)).max(20),
    exclude: z.array(z.string().max(500)).optional()
  }).optional(),
  output: z.object({
    dir: z.string().max(500).optional(),
    formats: z.array(z.enum(['markdown', 'json'])).optional()
  }).optional(),
  git: z.object({
    tagPattern: z.string().max(200).optional()
  }).optional()
}).strict();

function validateConfig(input: unknown) {
  try {
    return configSchema.parse(input);
  } catch (error) {
    if (error instanceof z.ZodError) {
      throw new ConfigValidationError(error.errors);
    }
    throw error;
  }
}

Security Checklist

Input Validation

  • All git refs validated before use
  • Schema paths validated (no traversal)
  • Configuration values validated
  • File sizes limited
  • JSON parsing uses safe methods

Git Operations

  • No shell injection via ref names
  • Git binary path validated
  • Repository paths validated
  • Remote URLs validated

File Operations

  • Path traversal prevention
  • Symlink attack prevention
  • File size limits enforced
  • Write permissions checked

Supply Chain

  • Dependencies pinned to specific versions
  • Lockfile committed
  • Dependencies audited regularly
  • GitHub Action uses pinned version

Data Handling

  • Schema content treated as untrusted
  • No eval() or Function() calls
  • No code execution from schema data
  • Sensitive data not logged

Error Handling

// Security-specific error classes
class SecurityError extends Error {
  constructor(message: string) {
    super(`Security violation: ${message}`);
    this.name = 'SecurityError';
  }
}

class PathTraversalError extends SecurityError {
  constructor(path: string) {
    super(`Path traversal attempt: ${path}`);
    this.name = 'PathTraversalError';
  }
}

class CommandInjectionError extends SecurityError {
  constructor(input: string) {
    super(`Potential command injection: ${input}`);
    this.name = 'CommandInjectionError';
  }
}

class ConfigValidationError extends SecurityError {
  constructor(errors: z.ZodError[]) {
    super(`Configuration validation failed: ${errors.map(e => e.message).join(', ')}`);
    this.name = 'ConfigValidationError';
  }
}

GitHub Action Security

# Good: Minimal permissions
permissions:
  contents: read
  pull-requests: write

# Bad: Overly permissive
permissions: write-all

# Good: Pin action version
- uses: reatech/mcp-changelog@v1.0.0

# Bad: Floating tag
- uses: reatech/mcp-changelog@v1

# Good: Validate inputs
inputs:
  schema-path:
    description: 'Path to schema file'
    required: false
  # Validate in code, not just YAML

Dependency Security

// package.json
{
  "dependencies": {
    "simple-git": "3.20.0",
    "commander": "11.1.0",
    "octokit": "3.1.2",
    "zod": "3.22.4"
  },
  "devDependencies": {
    "typescript": "5.3.3",
    "vitest": "1.1.0"
  },
  "overrides": {
    "inflight": "2.0.0"
  }
}
# Regular security audits
pnpm audit
npm audit
snyk test

Best Practices

1. Treat Schema Content as Untrusted

// Good: Schema data is just data
const schema = JSON.parse(content);
// Use schema.version, schema.tools as data only

// Bad: Execute schema content
eval(schema.transformCode); // NEVER
new Function(schema.code)(); // NEVER

2. Validate Before Processing

// Good: Validate first
const ref = validateGitRef(userInput);
const result = await git.revParse(ref);

// Bad: Process then handle errors
try {
  const result = await git.revParse(userInput);
} catch (e) {
  // Too late - git already processed potentially malicious input
}

3. Use Safe APIs

// Good: execa with argument array
await execa('git', ['show', `${ref}:${path}`]);

// Bad: Shell execution
await exec(`git show ${ref}:${path}`); // Shell injection risk

Security Testing

describe('Security', () => {
  it('should prevent path traversal', async () => {
    await expect(safeReadFile('/repo', '../../../etc/passwd'))
      .rejects.toThrow(PathTraversalError);
  });

  it('should reject malicious git refs', async () => {
    await expect(validateGitRef('$(rm -rf /)'))
      .rejects.toThrow();
  });

  it('should reject shell injection in refs', async () => {
    await expect(validateGitRef('v1.0.0; cat /etc/passwd'))
      .rejects.toThrow();
  });

  it('should validate configuration', async () => {
    await expect(validateConfig({ schema: { paths: ['../../../etc'] } }))
      .rejects.toThrow(ConfigValidationError);
  });

  it('should not execute schema content', async () => {
    const maliciousSchema = JSON.stringify({
      version: '1.0.0',
      tools: [],
      __proto__: { polluted: true }
    });

    const schema = JSON.parse(maliciousSchema);
    expect(({} as any).polluted).toBeUndefined();
  });
});

Resources

  • ARCHITECTURE.md - System architecture
  • Security section - Architecture security spec
  • OWASP Top 10 - Security reference
  • GitHub Security Lab - Security resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.