CWE-94
Allowed-with-ReviewImproper Control of Generation of Code ('Code Injection')
Abstraction: Base · Status: Draft
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
9394 vulnerabilities reference this CWE, most recent first.
GHSA-239G-WHFQ-7XJ9
Vulnerability from github – Published: 2026-09-30 23:27 – Updated: 2026-09-30 23:27Summary
Repo.__init__ decides which directory is the git directory by testing candidate paths in an order that
considers the real .git last. Two earlier tests can be satisfied by ordinary tracked files. Git
reserves only the literal name .git, so HEAD, objects/, refs/, config, gitdir, commondir
and hooks/ at a repository root are all legal tracked content.
Consequently, after a victim opens or clones an attacker's repository, GitPython resolves git_dir to
the working-tree root while real git correctly resolves <root>/.git. Everything GitPython then
treats as "inside the git directory" is attacker-authored content — including hooks/, which it
executes.
CVE-2026-87817
Affected code (3.1.59)
The discovery loop in git/repo/base.py tests, in order:
git/repo/base.py:299—isfile(curpath/gitdir)andisfile(curpath/commondir)andisfile(curpath/HEAD)git/repo/base.py:320—is_git_dir(curpath)git/repo/base.py:341—dotgit = osp.join(curpath, ".git")← the real git dir, considered last
is_git_dir (git/repo/fun.py:60) requires only that objects/ and refs/ are directories and that
HEAD is a file; HEAD's contents are never parsed. The hook path is resolved from
index.repo.git_dir (git/index/fun.py:73), i.e. the mis-resolved directory.
Proof of concept
Requires only pip install GitPython==3.1.59. Full script attached as poc1_rce.py; it runs entirely
in a temp directory and the payload only writes a marker file.
Attacker repository — four ordinary tracked files at the root:
| path | mode | content |
|---|---|---|
gitdir |
100644 | .git\n |
commondir |
100644 | .git\n |
HEAD |
100644 | ref: refs/heads/master\n |
hooks/pre-commit |
100755 | #!/bin/sh + payload |
Victim — two ordinary calls:
repo = git.Repo.clone_from(url, dst) # or git.Repo(dst)
repo.index.commit("automated commit") # code execution happens here
Observed on the PyPI release 3.1.59 (Linux and Windows):
real git says the git dir is : /tmp/.../victim/.git
GitPython says it is : /tmp/.../victim <- shadowed
attacker's hook executed : True
git fsck : (clean)
The pre-commit hook runs at git/index/base.py:1201, before write_tree(), so it fires even though
the commit later fails.
Impact
A service that opens or clones an untrusted repository with GitPython — a CI runner building a fork pull request, a code-scanning/SBOM service, a mirror, a dependency bot, an AI code-review/agent tool — can be made to:
- Execute arbitrary commands via the tracked
<root>/hooks/pre-commitwhen the victim callsindex.commit(). - Read files outside the repository: the tracked
<root>/configbecomes the repository config and is parsed withmerge_includes=True(git/repo/base.py:765), so[include] path = ~/.aws/credentialsdiscloses the file. (Repo._config_readerstill defaultsmerge_includes=True, so the hardening added in 3.1.59 for.gitmodules/GHSA-7833 does not cover this path.) - Write a config file to an attacker-chosen directory via an absolute tracked
commondir.
Delivery is silent: git clone exits 0, git fsck (including --strict, and with
transfer.fsckObjects/fetch.fsckObjects=true) reports nothing, and the clone passes every read-only
probe (head.commit, branches, is_dirty(), untracked_files, iter_commits) because a tracked
commondir of .git pins common_dir to the real .git.
Threat model / preconditions
- Attacker controls the content of a repository the victim opens or clones with GitPython (public repo, fork PR, mirrored dependency).
- For code execution, the victim performs a commit via GitPython's native
index.commit(). For the file-read impact, opening the repo and reading config is enough. GIT_WORK_TREEis not a mitigation —git_diris assigned and the discovery loop breaks before the environment is consulted.- Real git is unaffected; only GitPython mis-resolves the directory.
Remediation
- Test
curpath/.gitbefore thegitdir/commondir/HEADtriple and beforeis_git_dir(curpath). - Resolve
hook_path/_commit_hook_path/_get_validated_reflog_paththroughrepo.common_dir. - Containment-check
commondir/gitdircontents before joining (reuseSymbolicReference._get_validated_path). - Validate
HEADinis_git_dir(requireref: refs/...or a 40-hex sha). - Pass
merge_includes=FalseinRepo._config_reader(git/repo/base.py:765).
Note for the maintainers
Commit 406b98e1 (2026-05-31, "respect core.hooksPath for commit hooks") resolved the hook path via
git rev-parse --git-path, which is immune because git rediscovers the true .git. Commit 9bc287a2
(2026-07-20) reverted it to avoid an unconditional rev-parse dependency — reintroducing the exec step.
Measured at each commit with the healthy-looking layout: 406b98e1 → hook did not fire; 9bc287a2 …
3.1.59 → hook fired.
Scope note
Only the repository-root case is reported: where a real .git exists, git prefers it, and GitPython
does not. A fake git dir in a subdirectory fools real git too, so that variant is out of scope as a
general ecosystem hazard rather than a GitPython defect.
POC Files :
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.1.59"
},
"package": {
"ecosystem": "PyPI",
"name": "gitpython"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.60"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-87817"
],
"database_specific": {
"cwe_ids": [
"CWE-427",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-30T23:27:59Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\n`Repo.__init__` decides which directory is the git directory by testing candidate paths in an order that\nconsiders the real `.git` **last**. Two earlier tests can be satisfied by ordinary tracked files. Git\nreserves only the literal name `.git`, so `HEAD`, `objects/`, `refs/`, `config`, `gitdir`, `commondir`\nand `hooks/` at a repository root are all legal tracked content.\n\nConsequently, after a victim opens or clones an attacker\u0027s repository, GitPython resolves `git_dir` to\nthe **working-tree root** while real git correctly resolves `\u003croot\u003e/.git`. Everything GitPython then\ntreats as \"inside the git directory\" is attacker-authored content \u2014 including `hooks/`, which it\nexecutes.\n\n### CVE-2026-87817\n\n### Affected code (3.1.59)\n\nThe discovery loop in `git/repo/base.py` tests, in order:\n\n1. `git/repo/base.py:299` \u2014 `isfile(curpath/gitdir)` **and** `isfile(curpath/commondir)` **and** `isfile(curpath/HEAD)`\n2. `git/repo/base.py:320` \u2014 `is_git_dir(curpath)`\n3. `git/repo/base.py:341` \u2014 `dotgit = osp.join(curpath, \".git\")` \u2190 the real git dir, considered last\n\n`is_git_dir` (`git/repo/fun.py:60`) requires only that `objects/` and `refs/` are directories and that\n`HEAD` is a file; **`HEAD`\u0027s contents are never parsed.** The hook path is resolved from\n`index.repo.git_dir` (`git/index/fun.py:73`), i.e. the mis-resolved directory.\n\n### Proof of concept\n\nRequires only `pip install GitPython==3.1.59`. Full script attached as `poc1_rce.py`; it runs entirely\nin a temp directory and the payload only writes a marker file.\n\nAttacker repository \u2014 four ordinary tracked files at the root:\n\n| path | mode | content |\n|---|---|---|\n| `gitdir` | 100644 | `.git\\n` |\n| `commondir` | 100644 | `.git\\n` |\n| `HEAD` | 100644 | `ref: refs/heads/master\\n` |\n| `hooks/pre-commit` | **100755** | `#!/bin/sh` + payload |\n\nVictim \u2014 two ordinary calls:\n\n```python\nrepo = git.Repo.clone_from(url, dst) # or git.Repo(dst)\nrepo.index.commit(\"automated commit\") # code execution happens here\n```\n\nObserved on the PyPI release 3.1.59 (Linux and Windows):\n\n```\nreal git says the git dir is : /tmp/.../victim/.git\nGitPython says it is : /tmp/.../victim \u003c- shadowed\nattacker\u0027s hook executed : True\ngit fsck : (clean)\n```\n\nThe `pre-commit` hook runs at `git/index/base.py:1201`, before `write_tree()`, so it fires even though\nthe commit later fails.\n\n### Impact\n\nA service that opens or clones an untrusted repository with GitPython \u2014 a CI runner building a fork\npull request, a code-scanning/SBOM service, a mirror, a dependency bot, an AI code-review/agent tool \u2014\ncan be made to:\n\n1. **Execute arbitrary commands** via the tracked `\u003croot\u003e/hooks/pre-commit` when the victim calls\n `index.commit()`.\n2. **Read files outside the repository**: the tracked `\u003croot\u003e/config` becomes the repository config and\n is parsed with `merge_includes=True` (`git/repo/base.py:765`), so `[include] path = ~/.aws/credentials`\n discloses the file. (`Repo._config_reader` still defaults `merge_includes=True`, so the hardening\n added in 3.1.59 for `.gitmodules`/GHSA-7833 does not cover this path.)\n3. **Write a config file to an attacker-chosen directory** via an absolute tracked `commondir`.\n\nDelivery is silent: `git clone` exits 0, `git fsck` (including `--strict`, and with\n`transfer.fsckObjects`/`fetch.fsckObjects=true`) reports nothing, and the clone passes every read-only\nprobe (`head.commit`, `branches`, `is_dirty()`, `untracked_files`, `iter_commits`) because a tracked\n`commondir` of `.git` pins `common_dir` to the real `.git`.\n\n### Threat model / preconditions\n\n- Attacker controls the content of a repository the victim opens or clones with GitPython (public repo,\n fork PR, mirrored dependency).\n- For code execution, the victim performs a commit via GitPython\u0027s native `index.commit()`. For the\n file-read impact, opening the repo and reading config is enough.\n- `GIT_WORK_TREE` is **not** a mitigation \u2014 `git_dir` is assigned and the discovery loop breaks before\n the environment is consulted.\n- Real git is unaffected; only GitPython mis-resolves the directory.\n\n### Remediation\n\n1. Test `curpath/.git` **before** the `gitdir`/`commondir`/`HEAD` triple and before `is_git_dir(curpath)`.\n2. Resolve `hook_path` / `_commit_hook_path` / `_get_validated_reflog_path` through `repo.common_dir`.\n3. Containment-check `commondir`/`gitdir` contents before joining (reuse\n `SymbolicReference._get_validated_path`).\n4. Validate `HEAD` in `is_git_dir` (require `ref: refs/...` or a 40-hex sha).\n5. Pass `merge_includes=False` in `Repo._config_reader` (`git/repo/base.py:765`).\n\n### Note for the maintainers\n\nCommit `406b98e1` (2026-05-31, \"respect core.hooksPath for commit hooks\") resolved the hook path via\n`git rev-parse --git-path`, which is immune because git rediscovers the true `.git`. Commit `9bc287a2`\n(2026-07-20) reverted it to avoid an unconditional `rev-parse` dependency \u2014 reintroducing the exec step.\nMeasured at each commit with the healthy-looking layout: `406b98e1` \u2192 hook did not fire; `9bc287a2` \u2026\n`3.1.59` \u2192 hook fired.\n\n### Scope note\n\nOnly the **repository-root** case is reported: where a real `.git` exists, git prefers it, and GitPython\ndoes not. A fake git dir in a subdirectory fools real git too, so that variant is out of scope as a\ngeneral ecosystem hazard rather than a GitPython defect.\n\n###POC Files :\n[poc1_rce.py](https://github.com/user-attachments/files/31388464/poc1_rce.py)\n[poc2_file_read.py](https://github.com/user-attachments/files/31388465/poc2_file_read.py)",
"id": "GHSA-239g-whfq-7xj9",
"modified": "2026-09-30T23:27:59Z",
"published": "2026-09-30T23:27:59Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-239g-whfq-7xj9"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-87817"
},
{
"type": "WEB",
"url": "https://github.com/gitpython-developers/GitPython/pull/2218"
},
{
"type": "WEB",
"url": "https://github.com/gitpython-developers/GitPython/commit/c7cf4d13b1ed0a2e70f2a1f3c6b4fc6c2652cf0b"
},
{
"type": "PACKAGE",
"url": "https://github.com/gitpython-developers/GitPython"
},
{
"type": "WEB",
"url": "https://github.com/gitpython-developers/GitPython/releases/tag/3.1.60"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3982.yaml"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/gitpython-before-3.1.60-remote-code-execution-via-git-directory-impersonation"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "GitPython: Repository content can impersonate the git directory, leading to arbitrary code execution"
}
GHSA-23C5-W3PX-WX59
Vulnerability from github – Published: 2022-05-17 05:10 – Updated: 2022-05-17 05:10html/System-Files.php in the System File Overview feature in the NeDi component in GroundWork Monitor Enterprise 6.7.0 allows remote authenticated users to execute arbitrary commands via vectors involving file editing.
{
"affected": [],
"aliases": [
"CVE-2013-3508"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2013-05-08T12:09:00Z",
"severity": "MODERATE"
},
"details": "html/System-Files.php in the System File Overview feature in the NeDi component in GroundWork Monitor Enterprise 6.7.0 allows remote authenticated users to execute arbitrary commands via vectors involving file editing.",
"id": "GHSA-23c5-w3px-wx59",
"modified": "2022-05-17T05:10:22Z",
"published": "2022-05-17T05:10:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-3508"
},
{
"type": "WEB",
"url": "https://kb.groundworkopensource.com/display/SUPPORT/SA6.7.0-1+Some+web+components+allow+bypass+of+role+access+controls"
},
{
"type": "WEB",
"url": "https://www.sec-consult.com/fxdata/seccons/prod/temedia/advisories_txt/20130308-1_GroundWork_Monitoring_Multiple_high_risk_vulnerabilities_part2_wo_poc_v10.txt"
},
{
"type": "WEB",
"url": "http://www.kb.cert.org/vuls/id/345260"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-23CJ-73V4-6JX6
Vulnerability from github – Published: 2026-06-17 18:35 – Updated: 2026-06-17 18:35Vulnerability in the PeopleSoft Enterprise CS Campus Community product of Oracle PeopleSoft (component: Security). The supported version that is affected is 9.2.38. Difficult to exploit vulnerability allows unauthenticated attacker with network access via HTTP to compromise PeopleSoft Enterprise CS Campus Community. Successful attacks of this vulnerability can result in takeover of PeopleSoft Enterprise CS Campus Community. CVSS 3.1 Base Score 8.1 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
{
"affected": [],
"aliases": [
"CVE-2026-46851"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-06-17T10:54:02Z",
"severity": "HIGH"
},
"details": "Vulnerability in the PeopleSoft Enterprise CS Campus Community product of Oracle PeopleSoft (component: Security). The supported version that is affected is 9.2.38. Difficult to exploit vulnerability allows unauthenticated attacker with network access via HTTP to compromise PeopleSoft Enterprise CS Campus Community. Successful attacks of this vulnerability can result in takeover of PeopleSoft Enterprise CS Campus Community. CVSS 3.1 Base Score 8.1 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).",
"id": "GHSA-23cj-73v4-6jx6",
"modified": "2026-06-17T18:35:31Z",
"published": "2026-06-17T18:35:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-46851"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/cspujun2026.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-23F9-J3QR-H3HV
Vulnerability from github – Published: 2026-03-19 18:31 – Updated: 2026-03-24 03:31OS command injection in the CWMP client (/ftl/bin/cwmp) of Small Cell Sercomm SCE4255W (FreedomFi Englewood) firmware before DG3934v3@2308041842 allows remote attackers controlling the ACS endpoint to execute arbitrary commands as root via a crafted TR-069 Download URL that is passed unescaped into the firmware upgrade pipeline.
{
"affected": [],
"aliases": [
"CVE-2025-67113"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-19T18:16:15Z",
"severity": "CRITICAL"
},
"details": "OS command injection in the CWMP client (/ftl/bin/cwmp) of Small Cell Sercomm SCE4255W (FreedomFi Englewood) firmware before DG3934v3@2308041842 allows remote attackers controlling the ACS endpoint to execute arbitrary commands as root via a crafted TR-069 Download URL that is passed unescaped into the firmware upgrade pipeline.",
"id": "GHSA-23f9-j3qr-h3hv",
"modified": "2026-03-24T03:31:19Z",
"published": "2026-03-19T18:31:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67113"
},
{
"type": "WEB",
"url": "https://fcc.report/FCC-ID/P27-SCE4255W/4790935.pdf"
},
{
"type": "WEB",
"url": "https://freedomfi.com/index.html"
},
{
"type": "WEB",
"url": "https://neroteam.com/blog/freedomfi-sercomm-sce4255w-englewood"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-23MC-XGFJ-48F2
Vulnerability from github – Published: 2023-01-14 03:30 – Updated: 2023-01-23 21:30Tiki before 24.1, when feature_create_webhelp is enabled, allows lib/structures/structlib.php PHP Object Injection because of an eval.
{
"affected": [],
"aliases": [
"CVE-2023-22853"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-01-14T01:15:00Z",
"severity": "HIGH"
},
"details": "Tiki before 24.1, when feature_create_webhelp is enabled, allows lib/structures/structlib.php PHP Object Injection because of an eval.",
"id": "GHSA-23mc-xgfj-48f2",
"modified": "2023-01-23T21:30:25Z",
"published": "2023-01-14T03:30:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-22853"
},
{
"type": "WEB",
"url": "https://karmainsecurity.com/KIS-2023-02"
},
{
"type": "WEB",
"url": "https://tiki.org/articles"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-23P3-VCF6-94XQ
Vulnerability from github – Published: 2023-10-25 18:32 – Updated: 2023-11-01 18:30An issue in SeaCMS v.12.9 allows an attacker to execute arbitrary commands via the admin_safe.php component.
{
"affected": [],
"aliases": [
"CVE-2023-46010"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-10-25T18:17:35Z",
"severity": "CRITICAL"
},
"details": "An issue in SeaCMS v.12.9 allows an attacker to execute arbitrary commands via the admin_safe.php component.",
"id": "GHSA-23p3-vcf6-94xq",
"modified": "2023-11-01T18:30:31Z",
"published": "2023-10-25T18:32:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46010"
},
{
"type": "WEB",
"url": "https://blog.csdn.net/DGS666/article/details/133795200?spm=1001.2014.3001.5501"
},
{
"type": "WEB",
"url": "http://seacms.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-23PM-573J-2RQJ
Vulnerability from github – Published: 2022-05-17 04:19 – Updated: 2022-05-17 04:19CRLF injection vulnerability in the LightProcess protocol implementation in hphp/util/light-process.cpp in Facebook HipHop Virtual Machine (HHVM) before 2.4.2 allows remote attackers to execute arbitrary commands by entering a \n (newline) character before the end of a string.
{
"affected": [],
"aliases": [
"CVE-2014-2208"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-12-28T15:59:00Z",
"severity": "HIGH"
},
"details": "CRLF injection vulnerability in the LightProcess protocol implementation in hphp/util/light-process.cpp in Facebook HipHop Virtual Machine (HHVM) before 2.4.2 allows remote attackers to execute arbitrary commands by entering a \\n (newline) character before the end of a string.",
"id": "GHSA-23pm-573j-2rqj",
"modified": "2022-05-17T04:19:02Z",
"published": "2022-05-17T04:19:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-2208"
},
{
"type": "WEB",
"url": "https://github.com/facebook/hhvm/commit/506a44194a9016406c752ad8e010c01aeffc18cc"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-23Q9-V5C2-XG7M
Vulnerability from github – Published: 2022-05-01 02:21 – Updated: 2022-05-01 02:21PHP remote file inclusion vulnerability in content.php in phpGreetz 0.99 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the content parameter.
{
"affected": [],
"aliases": [
"CVE-2005-3861"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2005-11-29T11:03:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in content.php in phpGreetz 0.99 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the content parameter.",
"id": "GHSA-23q9-v5c2-xg7m",
"modified": "2022-05-01T02:21:50Z",
"published": "2022-05-01T02:21:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2005-3861"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/210"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1015276"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/417798/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/15575"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2005/2601"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-23R2-7V4M-M7MP
Vulnerability from github – Published: 2022-05-01 23:52 – Updated: 2022-05-01 23:52Static code injection vulnerability in guestbook.php in 1Book 1.0.1 and earlier allows remote attackers to upload arbitrary PHP code via the message parameter in an HTML webform, which is written to data.php.
{
"affected": [],
"aliases": [
"CVE-2008-2638"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-06-10T00:32:00Z",
"severity": "HIGH"
},
"details": "Static code injection vulnerability in guestbook.php in 1Book 1.0.1 and earlier allows remote attackers to upload arbitrary PHP code via the message parameter in an HTML webform, which is written to data.php.",
"id": "GHSA-23r2-7v4m-m7mp",
"modified": "2022-05-01T23:52:03Z",
"published": "2022-05-01T23:52:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2638"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42854"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5736"
},
{
"type": "WEB",
"url": "http://1scripts.net/php-scripts/index.php?p=16"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30146"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/1735/references"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-23V8-P364-5GVM
Vulnerability from github – Published: 2022-05-14 02:18 – Updated: 2022-05-14 02:18The management interface in F5 BIG-IP 9.4.3 allows remote authenticated users with Resource Manager privileges to inject arbitrary Perl code via unspecified configuration settings related to Perl EP3 with templates, probably triggering static code injection.
{
"affected": [],
"aliases": [
"CVE-2008-6474"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-03-16T16:30:00Z",
"severity": "HIGH"
},
"details": "The management interface in F5 BIG-IP 9.4.3 allows remote authenticated users with Resource Manager privileges to inject arbitrary Perl code via unspecified configuration settings related to Perl EP3 with templates, probably triggering static code injection.",
"id": "GHSA-23v8-p364-5gvm",
"modified": "2022-05-14T02:18:22Z",
"published": "2022-05-14T02:18:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6474"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/49308"
},
{
"type": "WEB",
"url": "http://osvdb.org/51116"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/490496/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28639"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-32
Strategy: Environment Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.