Skip to content

Commit 326978d

Browse files
authored
Bump gitpython to 3.1.62 and soupsieve to 2.9.2 (#365)
Both pins are flagged by pip-audit against the current lock: gitpython by CVE-2026-87817, CVE-2026-87818 and CVE-2026-87819, and the transitive soupsieve by GHSA-gjv8-xp57-g29c and GHSA-j934-xhv5-fg8f. Normalize the gitpython requirement to its lowercase PEP 503 name, matching uv.lock and the rest of the pins. Dependabot's uv updater errors on this entry with dependency_file_content_not_changed; the rename is a candidate fix for that. Move pip-audit out of the Unit Tests workflow into a Dependency Audit workflow with a daily schedule. The audit compares the lockfile against databases that publish continuously, so its result tracks the clock rather than the commit and needs a trigger to match. A failing scheduled run has no pull request to report on, so it opens a tracking issue and closes it once the audit is clean. Drop the paths filters from the pull_request triggers on Unit Tests and Version Check. A status check behind a paths filter produces no check context on a pull request that misses the filter, so those jobs cannot be marked required while the filters are in place. The push triggers keep theirs.
1 parent ccd4a45 commit 326978d

7 files changed

Lines changed: 187 additions & 28 deletions

File tree

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Dependency Audit
2+
3+
env:
4+
PYTHON_VERSION: "3.12"
5+
6+
# pip-audit compares the lockfile against advisory databases that publish
7+
# continuously, so the result tracks the clock, not the commit. Hence the cron.
8+
on:
9+
schedule:
10+
- cron: "17 6 * * *"
11+
# Unfiltered: a required check behind a paths filter never reports on a
12+
# pull request that misses the filter, which blocks the merge.
13+
pull_request:
14+
push:
15+
branches: [main]
16+
paths:
17+
- "pyproject.toml"
18+
- "uv.lock"
19+
- ".github/workflows/dependency-audit.yml"
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: dependency-audit-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
dependency-audit:
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
permissions:
34+
contents: read
35+
issues: write
36+
steps:
37+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
38+
with:
39+
fetch-depth: 1
40+
persist-credentials: false
41+
42+
- name: 🐍 setup python
43+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
44+
with:
45+
python-version: ${{ env.PYTHON_VERSION }}
46+
47+
- name: 🛠️ install uv
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install uv
51+
52+
- name: 🛡️ pip-audit (known CVEs in the locked deps)
53+
id: audit
54+
run: |
55+
uv export --no-hashes --no-emit-project --format requirements-txt > /tmp/req-audit.txt
56+
57+
set +e
58+
uvx pip-audit --strict --progress-spinner off --disable-pip --no-deps \
59+
-r /tmp/req-audit.txt 2>&1 | tee /tmp/audit.log
60+
status=${PIPESTATUS[0]}
61+
set -e
62+
63+
# Written before the exit so the next step can quote it.
64+
{
65+
echo 'report<<AUDIT_REPORT_EOF'
66+
cat /tmp/audit.log
67+
echo 'AUDIT_REPORT_EOF'
68+
} >> "$GITHUB_OUTPUT"
69+
70+
exit "$status"
71+
72+
# A scheduled run has no pull request to turn red, so record it instead.
73+
- name: 📮 open or update the tracking issue
74+
if: always() && steps.audit.outcome == 'failure' && github.event_name == 'schedule'
75+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
76+
env:
77+
AUDIT_REPORT: ${{ steps.audit.outputs.report }}
78+
with:
79+
script: |
80+
const marker = '<!-- dependency-audit-tracking-issue -->';
81+
const title = 'Dependency audit: known vulnerabilities in the locked dependencies';
82+
const runUrl =
83+
`${context.serverUrl}/${context.repo.owner}/${context.repo.repo}` +
84+
`/actions/runs/${context.runId}`;
85+
const body = [
86+
marker,
87+
'`pip-audit` found known vulnerabilities in the locked dependency set.',
88+
'',
89+
'Bump the affected pins in `pyproject.toml`, run `uv lock`, and open a PR.',
90+
'',
91+
'```',
92+
process.env.AUDIT_REPORT.trim(),
93+
'```',
94+
'',
95+
`Run: ${runUrl}`,
96+
`Last checked: ${new Date().toISOString()}`,
97+
].join('\n');
98+
99+
const existing = await github.paginate(github.rest.issues.listForRepo, {
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
state: 'open',
103+
per_page: 100,
104+
});
105+
const tracking = existing.find(
106+
(issue) => !issue.pull_request && issue.body && issue.body.includes(marker),
107+
);
108+
109+
if (tracking) {
110+
await github.rest.issues.update({
111+
owner: context.repo.owner,
112+
repo: context.repo.repo,
113+
issue_number: tracking.number,
114+
body,
115+
});
116+
core.notice(`Updated tracking issue #${tracking.number}`);
117+
} else {
118+
const created = await github.rest.issues.create({
119+
owner: context.repo.owner,
120+
repo: context.repo.repo,
121+
title,
122+
body,
123+
labels: ['dependencies'],
124+
});
125+
core.notice(`Opened tracking issue #${created.data.number}`);
126+
}
127+
128+
- name: ✅ close the tracking issue once the audit is clean
129+
if: always() && steps.audit.outcome == 'success' && github.event_name == 'schedule'
130+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
131+
with:
132+
script: |
133+
const marker = '<!-- dependency-audit-tracking-issue -->';
134+
const existing = await github.paginate(github.rest.issues.listForRepo, {
135+
owner: context.repo.owner,
136+
repo: context.repo.repo,
137+
state: 'open',
138+
per_page: 100,
139+
});
140+
const tracking = existing.find(
141+
(issue) => !issue.pull_request && issue.body && issue.body.includes(marker),
142+
);
143+
if (!tracking) {
144+
return;
145+
}
146+
await github.rest.issues.createComment({
147+
owner: context.repo.owner,
148+
repo: context.repo.repo,
149+
issue_number: tracking.number,
150+
body: 'The scheduled audit is clean again. Closing.',
151+
});
152+
await github.rest.issues.update({
153+
owner: context.repo.owner,
154+
repo: context.repo.repo,
155+
issue_number: tracking.number,
156+
state: 'closed',
157+
});

.github/workflows/python-tests.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ on:
1313
- "pyproject.toml"
1414
- "uv.lock"
1515
- ".github/workflows/python-tests.yml"
16+
# Unfiltered: a required check behind a paths filter never reports on a
17+
# pull request that misses the filter, which blocks the merge.
1618
pull_request:
17-
paths:
18-
- "socketsecurity/**/*.py"
19-
- "tests/unit/**/*.py"
20-
- "tests/core/**/*.py"
21-
- "pyproject.toml"
22-
- "uv.lock"
23-
- ".github/workflows/python-tests.yml"
2419
workflow_dispatch:
2520

2621
permissions:
@@ -62,10 +57,6 @@ jobs:
6257
from socketsecurity.config import CliConfig
6358
print('import smoke OK')
6459
"
65-
- name: 🛡️ pip-audit (known CVEs in the locked deps)
66-
run: |
67-
uv export --no-hashes --no-emit-project --format requirements-txt > /tmp/req-audit.txt
68-
uvx pip-audit --strict --progress-spinner off --disable-pip --no-deps -r /tmp/req-audit.txt
6960
7061
ruff:
7162
runs-on: ubuntu-latest

.github/workflows/version-check.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
name: Version Check
22
on:
3+
# Unfiltered: a required check behind a paths filter never reports on a
4+
# pull request that misses the filter, which blocks the merge.
35
pull_request:
46
types: [opened, synchronize, ready_for_review]
5-
paths:
6-
- 'socketsecurity/**'
7-
- 'pyproject.toml'
8-
- 'uv.lock'
9-
# Included so a change to the check itself is exercised by its own PR.
10-
- '.github/workflows/version-check.yml'
117

128
permissions:
139
contents: read

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 2.9.5
4+
5+
### Changed: bump pinned gitpython to 3.1.62 and soupsieve to 2.9.2
6+
7+
- Bumped `gitpython` from `3.1.59` to `3.1.62` (CVE-2026-87817, CVE-2026-87818,
8+
CVE-2026-87819) and the transitive `soupsieve` pin from `2.8.4` to `2.9.2`
9+
(GHSA-gjv8-xp57-g29c, GHSA-j934-xhv5-fg8f).
10+
- Normalized the `gitpython` requirement to its lowercase PEP 503 name.
11+
12+
### Changed: audit the locked dependencies on a schedule
13+
14+
- `pip-audit` moved out of the Unit Tests workflow into a new Dependency Audit
15+
workflow that also runs daily, so advisories published against unchanged pins
16+
are reported on their own schedule rather than on the next push.
17+
318
## 2.9.4
419

520
### Changed: bump pinned @coana-tech/cli to 15.10.46

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.9.4"
9+
version = "2.9.5"
1010
requires-python = ">= 3.11"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [
1313
"requests==2.34.2",
1414
"mdutils==1.8.1",
1515
"prettytable==3.18.0",
16-
"GitPython==3.1.59",
16+
"gitpython==3.1.62",
1717
"packaging==26.3",
1818
"python-dotenv==1.2.3",
1919
"socketdev==3.6.0",

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.9.4'
2+
__version__ = '2.9.5'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

uv.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)