agentleFS
MicrosoftKnown publishermicrosoft/TypeScript/.github/skills/security-report-check/SKILL.md

security-report-check

Skill111k starsChanged 2 years agoApache-2.0View on GitHub

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.

Trending

Steady talk.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 2 mentionsSep 2026: 1 mentionOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/TypeScript repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/TypeScript

The biggest 5 of 104 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 104

Talked about on Bluesky, Hacker News and GitHub (104 times).

On Bluesky · 50

45 more on Bluesky

On Hacker News · 43

38 more on Hacker News

On GitHub · 11

6 more on GitHub

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only pass the --runExternalCode flag if you have validated which content mappers are available and that you are OK with running them.

    line 27
  2. Distinctive:

    If an attacker has control of an input TS file, they can of course control the contents of the output JS file.

    line 51
  3. Distinctive:

    Use of standard sandboxing strategies is recommended to secure scenarios similar to this.

    line 59
  4. Very specific:

    If this file is modified, it can cause tsc to e.g.

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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 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.

Workspace Trust is Your Responsibility

Remember the definition of Workspace Trust (emphasis added):

The Workspace Trust feature lets you decide whether code in your project folder can be executed by VS Code and extensions without your explicit approval.

Features like Content Mappers, including when they come from node_modules, are part of this "code in your project" and will run if you trust a workspace containing them. This also includes TypeScript itself if you have enabled using the workspace version of TypeScript (again e.g. from node_modules). The TypeScript Language Service doesn't provide additional barriers to this execution. Remember to only enable Workspace Trust for workspaces that you trust, i.e. are willing to run code from.

Go Compiler CVEs

The Go compiler is frequently updated to address CVEs in its core components and standard library. These normally do not affect TypeScript - for example, a CVE in Go's HTTP library is not reachable from tsc, so is not relevant to TypeScript security. We do not issue patch releases of TypeScript to adopt newer versions of Go unless there is an identified path to a particular CVE. We recommend using govulncheck instead of a blanket version-based scan to identify potential issues.

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.

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.