security-report-check

关于在该仓库开展安全研究或提交安全问题报告的说明性文档。列出该文档所提供的保证与不保证的内容;在报告安全问题或进行安全研究之前请先查阅。

仓库最近推送
GitHub Stars
111,870
Forks
14,613
Issues / PRs
4,956

预览截图

来自skillπ 实验室的展示

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "security-report-check":https://skillpi.com/zh/skills/deepskill-6f046f72a3c37fc4041e279006c47268fcee3396f29c729cd7146669d36ecf4e。安装前核对上游来源和版本:https://github.com/microsoft/TypeScript。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

关于在该仓库开展安全研究或提交安全问题报告的说明性文档。列出该文档所提供的保证与不保证的内容;在报告安全问题或进行安全研究之前请先查阅。

0 下载

介绍来源: third_party · microsoft · 0.0.1 参考来源

SkillPi 解读

能完成的任务
TypeScript 编译器( `tsc` )是**建工具**,不是沙盒. 它将TypeScript源文件转换为JavaScript输出文件,并报告潜在的错误. 本文描述的是: `tsc` 保证,在援引未经信任的投入时不保证。
适合谁
来源文档未说明。
输入和输出
如果攻击者控制了输入的TS文件,他们当然可以控制输出JS文件的内容. 取决于对输入文件的控制和执行输出文件的攻击不被认为是编译器安全问题,因为攻击者已经控制了输入文件.
软件、账号及付费要求
来源文档未说明。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: security-report-check
description: >
  Are you doing security research on this repo?
  This document covers what guarantees and non-guarantees are provided.
  Consult this document before reporting a security issue or conducting security research.

Security Properties of tsc

Overview

The TypeScript compiler (tsc) is a build tool, not a sandbox. It transforms TypeScript source files into JavaScript output files and reports potential errors. This document describes what tsc guarantees and does not guarantee when invoked on untrusted input.

Security Guarantees

No arbitrary code execution

Running tsc on a malicious .ts or tsconfig.json file will never cause the input code to be executed. The compiler parses, type-checks, and emits; it does not evaluate the programs it compiles. There is no eval-at-compile-time, no macro system, and no plugin mechanism that runs author-supplied code during compilation. This is the core security property of tsc.

Exception: If content mappers are enabled, this does enable execution of third-party code. Only pass the --runExternalCode flag if you have validated which content mappers are available and that you are OK with running them.

Limited default side effects.

Outside of explicitly enabled external code, compiler invocations interact with the system through file-system operations and process I/O. Depending on the options, tsc may write compiler, build-info, trace, or profile files, update output timestamps, or delete build outputs (for example, with --build --clean).

The compiler does not make HTTP requests or spawn child processes except through content mappers.

Safe exit. Certain adversarial inputs may cause crashes, but these crashes will unwind the process normally, and will not be a source of buffer overrun or other memory safety exploit vectors.

Non-Guarantees

Arbitrary file writes

tsc writes compiler output to paths derived from its configuration (outDir, outFile, declarationDir, etc.) and the structure of the input project. It is expected that a given tsconfig.json can direct output to any path writable by the calling user. This is by design: writing files to disk is the point of a compiler. Callers who need to constrain output locations must do so externally (e.g., filesystem permissions, containers, sandboxing). Similarly, running tsc --build --clean may delete files from disk; crafted .tsbuildinfo or tsconfig.jsons may cause any file to be deleted.

Input code is output code

If an attacker has control of an input TS file, they can of course control the contents of the output JS file. Attacks that depend on control of the input file and execution of the output file are not considered compiler security issues, because the attacker already has control of the input file.

File read sandboxing

tsc will read files from paths specified in input files, and transitive references from there, including import paths and reference directives. An attacker in control of these files may therefore cause a read of any file path the tsc process has privileges to read, and tsc may reprint certain file contents in its output messages. In other words, for example, it is not generally safe to run tsc on untrusted code and print back the error message contents to an untrusted party, as this could expose local filesystem contents to the attacker. Use of standard sandboxing strategies is recommended to secure scenarios similar to this.

Resource consumption

TypeScript's type system is Turing-complete. A crafted input file can cause tsc to consume unbounded CPU time or memory during type-checking, and in fact small type constructs that can consume a large amount of time are common and intentional. Routine compilations of normal code can legitimately take multiple minutes and gigabytes of memory, so there is no reliable way to distinguish between a "normal" long-running compilation and an adversarially-constructed one.

Callers operating on untrusted input should enforce resource limits externally (e.g., ulimit, cgroups, process timeouts). You should not assume that an adverserially-constructed program will successfully typecheck in any bounded amount of time. "Local Denial of Service (DoS)" is thus not a security report; if you encounter a performance problem, you can report this through the normal issue tracker.

Crashes

tsc may gracefully crash, hang, or produce unexpected diagnostics when given adversarial input. While crashes in "normal" code are treated as bugs and fixed when reported, the compiler does not guarantee non-crashing in the presence of all possible malformed inputs (e.g. an unbounded series of f(f(f(f(...).

tsbuildinfo

The .tsbuildinfo file is a cache of compiler state that is used to speed up incremental compilation. If this file is modified, it can cause tsc to e.g. fail to build a file because it thinks the file is up-to-date, or to recompile a file that has not changed. .tsbuildinfo files should be considered as sensitive as tsconfig.json files in terms of security; an attacker who can modify them can cause arbitrary file reads and writes.

Language Service

The TypeScript Language Service (LS) only executes in the context of a trusted workspace (VS Code) or trusted folder (VS). Similar to tsc, there are no guaranteed resource caps in the LS, and "hangs" may occur in the presence of adversarial inputs.

Examples

Hypothetically Valid Security Reports

  • Running tsc malicious.ts executes top-level code from malicious.ts, even though --runExternalCode was not passed.
  • A specially crafted source file causes tsc to launch an attacker-chosen executable, even though --runExternalCode was not passed.
  • A malformed input exploits a memory-safety flaw to execute arbitrary native code rather than merely causing the tsc process to exit.

Hypothetically Invalid Security Reports

  • A recursive conditional type causes the reporter's local tsc process to use all available CPU or memory, hang, or terminate with a stack overflow.
  • A malicious tsconfig.json directs emitted JavaScript or declarations to an unexpected path that is writable by the user running tsc.
  • A project causes tsc --build --clean to delete a file that the invoking user has permission to delete.
  • An import or reference directive causes tsc to read a local file, and a diagnostic reveals some of that file's contents to the caller.
  • Attacker-controlled TypeScript produces attacker-controlled JavaScript that performs a malicious action when executed.
  • A malformed source file crashes tsc without escaping the process or causing memory corruption.
  • A content mapper executes code after the caller explicitly enables content mappers with --runExternalCode.

版本历史

  1. vscode-typescript/v1.0.2 GitHub ↗
    原版更新说明

    Bundles TypeScript 7.0.2 from commit b37cbdc6886df3c2a34cbde8d20fbb4637a35503.

  2. vscode-typescript/v1.0.1 GitHub ↗
    原版更新说明

    Bundles TypeScript 7.0.2 from commit b6eaace9d7cfd63c018ab25340ba463baae07fb5.

  3. v7.0.2 GitHub ↗
    原版更新说明

    https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/ This tag was originally released at: https://github.com/microsoft/typescript-go/releases/tag/typescript%2Fv7.0.2

  4. v6.0.3 GitHub ↗
    原版更新说明

    For release notes, check out the [release announcement blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/). * [fixed issues query for TypeScript 6.0.0 (Beta)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.0%22). * [fixed issues query for TypeScript 6.0.1 (RC)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.1%22). * [fixed issues query for TypeScript 6.0.2 (Stable)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.2%22). * [fixed issues query for TypeScript 6.0.3 (Stable)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.3%22). Downloads are available on: * [npm](https://www.npmjs.com/package/typescript)

  5. v6.0.2 GitHub ↗
    原版更新说明

    For release notes, check out the [release announcement blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/). * [fixed issues query for TypeScript 6.0.0 (Beta)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.0%22). * [fixed issues query for TypeScript 6.0.1 (RC)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.1%22). * [fixed issues query for TypeScript 6.0.2 (Stable)](https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=milestone%3A%22TypeScript+6.0.2%22). Downloads are available on: * [npm](https://www.npmjs.com/package/typescript)

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值62/100

待提升项

  • 文档长度较长 原报告严重程度:轻微

    文档内容约450行,虽未超限但建议适当拆分或添加导航

    改进建议:考虑将文档拆分为多个子文档或添加目录导航提升可读性

亮点

  • 专业性强,面向安全研究人员提供明确指导
  • 内容详实,覆盖安全审计的关键场景和边界情况
触发精准85/100

亮点

  • 触发词清晰明确,覆盖安全研究相关场景
  • description准确描述了文档用途和适用场景
结构规范88/100

亮点

  • 结构完整,章节划分清晰
  • frontmatter完整,包含必要元数据
  • 提供具体示例帮助理解
执行可靠92/100

亮点

  • 内容准确严谨,逻辑清晰
  • 覆盖主要异常场景和边界情况
  • 对安全边界有明确说明
证据可验 (前四项均值)82/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • code.visualstudio.com
  • learn.microsoft.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

来源文档未说明。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。