perl-security

Applies secure coding patterns for Perl covering taint mode, DBI queries, and web security.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill perl-security-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: perl-security
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/perl-security
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill perl-security-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Perl applications that handle user input, execute system commands, or query databases are prone to injection attacks, path traversal, and XSS vulnerabilities. This Skill provides concrete secure coding patterns so Perl code touching user input, the shell, or the network follows safe defaults before shipping. ## Core Features & Use Cases - Taint Mode & Input Validation: Enable -T taint checking, untaint inputs with strict allowlist regexes, and enforce length constraints. - Injection Prevention: Use three-argument open, list-form system calls, and DBI parameterized queries to block command and SQL injection. - Web Security: Apply output encoding with HTML::Entities, CSRF token generation, secure session configuration, and perlcritic security policies for automated auditing. - Use Case: When reviewing a Mojolicious or CGI application, use this Skill to verify every DBI query uses placeholders, all file opens use the three-argument form, and templates auto-escape user content. ## Quick Start Review my Perl web application code for security vulnerabilities and rewrite any unsafe patterns using taint mode, parameterized DBI queries, and proper output encoding.

Frequently Asked Questions about perl-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in Perl DBI queries?▼

Use DBI placeholders for every query: prepare statements with ? markers and pass values through execute(). Never interpolate variables into SQL strings. For dynamic column names, validate against an explicit allowlist before interpolation.

How to safely execute system commands in Perl?▼

Use the list form of system() or exec(), which bypasses shell interpolation entirely. For capturing output, use IPC::Run3 or Capture::Tiny instead of backticks. Avoid string-form system calls with user-supplied data.

What is Perl taint mode and when should I use it?▼

Taint mode, enabled with the -T flag, tracks data from external sources and blocks its use in unsafe operations until explicitly validated. Enable it for all CGI and web-facing scripts, then untaint inputs with specific allowlist regexes.

Does perlcritic support security-focused code analysis?▼

Yes, perlcritic includes security policies such as RequireThreeArgOpen, ProhibitStringyEval, ProhibitBacktickOperators, and RequireTaintChecking. Run it with --theme security at severity 3 or higher, and integrate it into CI pipelines.

Why is two-argument open dangerous in Perl?▼

Two-argument open interprets special characters in the filename, so a value like '|rm -rf /' executes a shell command. Always use the three-argument form with an explicit mode and a lexical filehandle to eliminate this injection vector.

How do I prevent ReDoS attacks in Perl regular expressions?▼

Avoid nested quantifiers like (a+)+ which cause exponential backtracking. Rewrite patterns with single quantifiers, use possessive quantifiers or atomic groups, and wrap untrusted pattern matching in an alarm-based timeout.