Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 69 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,78 @@
# 项目简介
<font style="color:rgb(31, 35, 40);">统一多语言程序分析是一个</font><font style="color:#1f2328;">面向工业界大规模落地的</font><font style="color:rgb(31, 35, 40);">静态程序分析工具。它为多语言定义了</font>统一的抽象语法树(UAST)中间表示,基于UAST和模拟执行技术,实现了高精度的数据流、指针分析和污点分析,并同时提供了命令式和声明式两种规则扩展能力供用户灵活、低成本使用,可广泛应用于代码安全等场景。
<img src="folder-img/logo.png" style="width:50%;" />

# 核心功能
+ 定义了统一的多语言的抽象语法树(UAST)中间表示,并提供了各语言向UAST转换的工具
+ 高精度的数据流、指针分析和污点分析
+ 可扩展的规则定制化能力,包括命令式规则和声明式查询语言
+ 内置常见的安全检测规则,面向安全检测场景可开箱即用
#### [简体中文](README_ZH.md) / [English](README.md)

# 项目架构
![](https://intranetproxy.alipay.com/skylark/lark/0/2025/png/178787/1743992792193-33a83234-5229-481d-a4b6-e99a796a2fc0.png)
**YASA** (**Y**et **A**nother **S**tatic **A**nalyzer, pronounced “**YA-sa**”) is an open-source static program analysis project. Its core innovation lies in a unified intermediate representation called the **U**nified **A**bstract **S**yntax **T**ree (UAST), designed to support multiple programming languages. Built on top of UAST, YASA provides a highly accurate static analysis framework. Users can extend its capabilities by writing custom checkers to perform various program analysis tasks—such as AST queries, data flow analysis, and function call graph analysis—and expose functionality through SDK, declarative query language (QL), or MCP.

**QL**:Query Language
As a project originally developed within a security team, YASA also comes with built-in taint analysis capabilities, implemented as a checker, to detect security vulnerabilities.

**<font style="color:rgb(0, 0, 0);">UAST</font>**<font style="color:rgb(0, 0, 0);">:Unify Abstract Syntax Tree </font>**统一抽象语法树**
## Components
<img src="folder-img/Structure.jpg" />

**<font style="color:rgb(0, 0, 0);">YASA</font>**<font style="color:rgb(0, 0, 0);"> :Yet Another Static Analyzer</font>
### YASA-UAST: Unified Abstract Syntax Tree
[YASA-UAST](https://github.com/antgroup/YASA-UAST) is an intermediate representation structure for multi-language program analysis. The UAST-Parser parses code from different programming languages into a unified abstract syntax format. Through UAST, source code in different languages can be converted into a standardized tree structure, enabling unified analysis and processing across multiple languages.

# 技术优势
+ 【统一】统一多语言抽象语法树(UAST)中间表示,可低成本支持新语言,便于跨语言的分析
+ 【高精度】多语言程序模拟执行技术,还原了真实的程序运行上下文,可提供更高的分析精度
+ 【工业界落地】经过蚂蚁内部大规模落地和业界首个程序分析评价体系开源项目[xast](https://xastbenchmark.github.io/)的“双重认证”,多语言场景下的分析完整度、准确度和性能都有较高保障
+ 【低使用成本】命令式程序分析combine声明式查询语句
- 兼容[Github codeql](https://github.com/github/codeql)的语法和规则,用户使用门槛低
- 提供了灵活的规则定制能力
### YASA-Engine: Unified multi-language Analysis Engine
The unified multi-language analysis engine is the core component of a modern program analysis platform. It aims to achieve efficient and precise analysis of multiple programming languages through a unified analysis framework and methodology. Also, with the help of AI capabilities, it addresses issues such as broken chains in traditional program analysis and high adaptation costs for new scenarios. (The AI part is not open-sourced yet.)

# <font style="color:rgb(31, 35, 40);">支持的语言</font>
<font style="color:rgb(31, 35, 40);">Java、JS、Go、Python......</font>
### YASA-UQL: Unified Declarative Rule Query Language
Supports declarative unified query rule writing for multiple languages, compatible with CodeQL syntax, lowering the barrier to rule writing while unifying rule sets across languages.

<font style="color:rgb(31, 35, 40);">其他语言的支持为开源社区共建“留白”</font>
### YASA-MCP: Unified multi-language Program Analysis MCP
Provides atomic analysis APIs for LLM, offering program analysis services that are LLM-friendly.

### YASA-SDK: Unified multi-language Program Analysis SDK
Provides SDK packages supporting multiple programming languages for traditional applications. It provides a variety of granular program analysis APIs, making integration easier and enabling efficient and user-friendly program analysis services within applications.

### xAST
[xAST](https://github.com/alipay/ant-application-security-testing-benchmark) is an open-source evaluation system for SAST/IAST/DAST tool capabilities. In YASA-Engine, it serves as the regression target for post-change testing, and during the process of multi-language adaptation, it provides positive guidance on language syntax support.

## Technical Advantages
### Low Cost for New Language Support
- YASA is directly modeled and analyzed based on UAST. When adapting to a new language, once it is parsed into UAST, the general-layer analyzer's capabilities can be used. After supporting the new language's package structure, the new language's analysis is already supported.

<img src="folder-img/newLanguage.jpg" style="width:90%;" />


### High Analysis Accuracy, Measurable, and Unified Multi-Languages
- YASA is based on unified multi-language symbolic interpretation capabilities, offering high precision and scalability in static code analysis. It naturally supports field-sensitive, context-sensitive, object-sensitive, path-sensitive, and flow-sensitive capabilities in the field of static analysis.

- During YASA's development, we used [xAST](https://github.com/alipay/ant-application-security-testing-benchmark) to evaluate and verify our capabilities, achieving "measurable capabilities." We compared YASA's performance with other open-source program analysis tools under the xAST evaluation system:

<img src="folder-img/xastTest.jpg" style="width:90%;" />

### Open and Friendly
- Introduced the unified declarative rule query language YASA-UQL, compatible with CodeQL syntax, and pioneered a unified QL rule library for multiple languages, making program analysis more engineer-friendly.

- Launched YASA MCP (LLM-friendly) and SDK (App development-friendly).

## Quick Start

[Getting Started](https://www.yuque.com/u22090306/bebf6g/evyf4chw26deq8xq)

[Installation and Deployment](https://www.yuque.com/u22090306/bebf6g/gm7b32tcn9vosgll)

## Join Us
Welcome to submit issues if you encounter any problems!

For code contributions, please refer to [CONTRIBUTION](CONTRIBUTION.md)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link points to CONTRIBUTION.md, but the file in the repository is named CONTRIBUTING.md. This will result in a broken link.

Suggested change
For code contributions, please refer to [CONTRIBUTION](CONTRIBUTION.md)
For code contributions, please refer to [CONTRIBUTION](CONTRIBUTING.md)


## Resource Links
[Official Documentation](https://www.yuque.com/u22090306/bebf6g)

[Learning Resources](https://www.yuque.com/u22090306/bebf6g/sr0y5fqg0kcua5nf)

[Community Activities](https://www.yuque.com/u22090306/bebf6g/fn1rauxwtp7z0l1u)

## Open Source License
Apache License 2.0 - Details in LICENSE Apache-2.0.

## Acknowledgments
Thanks to all developers who have contributed to the YASA project! Special thanks to the open-source community for their support and feedback, enabling us to jointly advance the development of program analysis technology.

YASA - Making code analysis more precise, easier, and smarter.

## Contact Us
[Official Website](https://cybersec.antgroup.com/station)

<img src="folder-img/contactus.png" style="width:20%;" />
Loading