perl-security
Comprehensive Perl security guidance covering taint mode, input validation, safe process execution, parameterized DBI queries, web security (XSS/SQLi/CSRF), and perlcritic security policies.
Translation reviewedRead the original Chinese text
全面的Perl安全指南,涵盖污染模式、输入验证、安全进程执行、DBI参数化查询、Web安全(XSS/SQLi/CSRF)以及perlcritic安全策略。
Target: Cloud, operations & security. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Chinese text
Topics in the source
- Perl 安全模式
- 何时启用
- 工作原理
- 污染模式
- 启用污染模式
- 净化模式
- 输入验证
- 允许列表优于阻止列表
涵盖输入验证、注入预防和安全编码实践的 Perl 应用程序全面安全指南。 处理 Perl 应用程序中的用户输入时 构建 Perl Web 应用程序时(CGI、Mojolicious、Dancer2、Catalyst) 审查 Perl 代码中的安全漏洞时 使用用户提供的路径执行文件操作时 从 Perl 执行系统命令时 编写 DBI 数据库查询时 从污染感知的输入边界开始,然后向外扩展:验证并净化输入,保持文件系统和进程执行受限,并处处使用参数化的 DBI 查询。下面的示例展示了在交付涉及用户输入、shell 或网络的 Perl 代码之前,此技能期望您应用的安全默认做法。 Perl 的污染模式(-T)跟踪来自外部源的数据,并防止其在未经明确验证的情况下用于不安全操作。 嵌套的量词应用于重叠模式时会发生灾难性回溯。 使用 File::Temp 处理临时文件(tempfile(UNLINK => 1)),并使用 flock(LOCKEX) 防止竞态条件。 也可以使用 Capture::Tiny 安全地捕获外部命令的标准输出和标准错误。 验证令牌时使用恒定时间比较。大多数 Web 框架(Mojolicious、Dancer2、Catalyst)都提供内置的 CSRF 保护——优先使用这些而非自行实现的解决方案。 始终根据上下文对输出进行编码:HTML 使用 HTML::Entities::encodeentities(),URL 使用 URI::Escape::uriescapeutf8(),JSON 使用 JSON::MaybeXS::encodejson()。 固定版本 在 cpanfile 中:requires 'DBI', '== 1.643'; 优先使用维护中的模块:在 MetaCPAN 上检查最新发布版本 最小化依赖项:每个依赖项都是一个攻击面 | 检查项 | 需验证的内容 | |---|---| | 污染模式 | CGI/web 脚本上使用 -T 标志 | | 输入验证 | 允许列表模式,长度限制 | | 文件操作 | 三参数 open,路径遍历检查 | | 进程执行 | 列表形式的 system,无 shell 插值 | | SQL 查询 | DBI 占位符,绝不插值 | | HTML 输出 | encodeentities(),模板自动转义 | | CSRF 令牌 | 生成令牌,并在状态更改请求时验证 | | 会话配置 | 安全、HttpOnly、SameSite Cookie | | HTTP 标头 | CSP、X-Frame-Options、HSTS | | 依赖项 | 固定版本,已审计模块 | | 正则表达式安全 | 无嵌套量词,锚定模式 | | 错误消息 | 不向用户泄露堆栈跟踪或路径 | 请记住:Perl 的灵活性很强大,但需要纪律。对面向
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- docs/zh-CN/skills/perl-security/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Requirements
- Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.
A small first task
先阅读原作者说明,再决定是否在自己的 AI 工具中使用。
Instructions for your AI tool
- Claude Desktop: resource-specific guide not available yet
- Claude Code: resource-specific guide not available yet
- Cursor: resource-specific guide not available yet
- Codex: resource-specific guide not available yet
Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:42.500Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.