Skip to content

Commit 63c3355

Browse files
Merge pull request #4926 from linuxfoundation/unicron-address-codeql-and-dependabot-vulns
Unicron address codeql and dependabot vulns
2 parents 9a60fc9 + 370fcb5 commit 63c3355

14 files changed

Lines changed: 2160 additions & 1097 deletions

File tree

cla-backend-go/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// SPDX-License-Identifier: MIT
33
module github.com/linuxfoundation/easycla/cla-backend-go
44

5-
go 1.24
5+
go 1.24.0
6+
7+
toolchain go1.24.4
68

79
replace github.com/awslabs/aws-lambda-go-api-proxy => github.com/LF-Engineering/aws-lambda-go-api-proxy v0.3.2
810

@@ -68,12 +70,12 @@ require (
6870
require (
6971
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1
7072
github.com/bradleyfalzon/ghinstallation/v2 v2.2.0
71-
github.com/golang-jwt/jwt v3.2.2+incompatible
72-
github.com/golang-jwt/jwt/v4 v4.5.0
73+
github.com/golang-jwt/jwt/v4 v4.5.2
7374
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0
7475
go.opentelemetry.io/otel v1.40.0
7576
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0
7677
go.opentelemetry.io/otel/sdk v1.40.0
78+
go.opentelemetry.io/otel/trace v1.40.0
7779
)
7880

7981
require (
@@ -131,7 +133,6 @@ require (
131133
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
132134
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
133135
go.opentelemetry.io/otel/metric v1.40.0 // indirect
134-
go.opentelemetry.io/otel/trace v1.40.0 // indirect
135136
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
136137
golang.org/x/text v0.33.0 // indirect
137138
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect

cla-backend-go/go.sum

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,9 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V
285285
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
286286
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
287287
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
288-
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
289-
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
290-
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
291288
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
289+
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
290+
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
292291
github.com/golang/dep v0.5.4/go.mod h1:6RZ2Wai7dSWk7qL55sDYk+8UPFqcW7all2KDBraPPFA=
293292
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
294293
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=

cla-backend-go/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"resolutions": {
3333
"axios": "^0.30.3",
34+
"tar": "^7.5.10",
3435
"ansi-regex": "^5.0.1",
3536
"aws-sdk": "^2.1329.0",
3637
"cookiejar": "^2.1.4",
@@ -48,7 +49,6 @@
4849
"ws": ">=7.5.10",
4950
"xmlhttprequest-ssl": "^1.6.2",
5051
"form-data": "^4.0.4",
51-
"tar": "^7.5.8",
5252
"minimatch": "^10.2.1",
5353
"fast-xml-parser": "^5.3.6"
5454
}

cla-backend-go/v2/sign/jwt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package sign
66
import (
77
"time"
88

9-
"github.com/golang-jwt/jwt"
9+
"github.com/golang-jwt/jwt/v4"
1010
log "github.com/linuxfoundation/easycla/cla-backend-go/logging"
1111
"github.com/linuxfoundation/easycla/cla-backend-go/utils"
1212
"github.com/sirupsen/logrus"

cla-backend-go/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,10 +5032,10 @@ tar-stream@^2.1.0, tar-stream@^2.2.0:
50325032
inherits "^2.0.3"
50335033
readable-stream "^3.1.1"
50345034

5035-
tar@^6.1.15, tar@^7.5.8:
5036-
version "7.5.9"
5037-
resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.9.tgz#817ac12a54bc4362c51340875b8985d7dc9724b8"
5038-
integrity sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==
5035+
tar@^6.1.15, tar@^7.5.10:
5036+
version "7.5.11"
5037+
resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.11.tgz#1250fae45d98806b36d703b30973fa8e0a6d8868"
5038+
integrity sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ==
50395039
dependencies:
50405040
"@isaacs/fs-minipass" "^4.0.0"
50415041
chownr "^3.0.0"

cla-backend/cla/models/github_models.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ def get_repository_id(self, repo_name, installation_id=None):
182182
cla.log.error("Unknown error while getting GitHub repository ID for repository %s: %s", repo_name, str(err))
183183

184184
def received_activity(self, data):
185-
cla.log.debug("github_models.received_activity - Received GitHub activity: %s", data)
185+
cla.log.debug(
186+
"github_models.received_activity - received GitHub activity action=%s pull_request=%s merge_group=%s",
187+
data.get("action"),
188+
"pull_request" in data,
189+
"merge_group" in data,
190+
)
186191
if "pull_request" not in data and "merge_group" not in data:
187192
cla.log.debug("github_models.received_activity - Activity not related to pull request - ignoring")
188193
return {"message": "Not a pull request nor a merge group - no action performed"}
@@ -206,7 +211,7 @@ def received_activity(self, data):
206211

207212
def user_from_session(self, request, get_redirect_url):
208213
fn = "github_models.user_from_session"
209-
cla.log.debug(f"{fn} - loading session from request: {request}...")
214+
cla.log.debug(f"{fn} - loading session from request")
210215
session = self._get_request_session(request)
211216
cla.log.debug(f"{fn} - session loaded (keys={list(session.keys())})")
212217

@@ -217,7 +222,7 @@ def user_from_session(self, request, get_redirect_url):
217222
if user is None:
218223
cla.log.debug(f"{fn} - cannot find user, returning HTTP 404 status")
219224
else:
220-
cla.log.debug(f"{fn} - loaded user {user.to_dict()} returning HTTP 200 status")
225+
cla.log.debug(f"{fn} - loaded user returning HTTP 200 status")
221226
return user
222227

223228
authorization_url, csrf_token = self.get_authorization_url_and_state(None, None, None, ["user:email"], state='user-from-session')
@@ -245,7 +250,7 @@ def sign_request(self, installation_id, github_repository_id, change_request_id,
245250
)
246251

247252
# Not sure if we need a different token for each installation ID...
248-
cla.log.debug(f"{fn} - Loading session from request: {request}...")
253+
cla.log.debug(f"{fn} - Loading session from request")
249254
session = self._get_request_session(request)
250255
cla.log.debug(f"{fn} - Adding github details to session: {list(session.keys())} which is type: {type(session)}...")
251256
session["github_installation_id"] = installation_id
@@ -254,9 +259,9 @@ def sign_request(self, installation_id, github_repository_id, change_request_id,
254259

255260
cla.log.debug(f"{fn} - Determining return URL from the inbound request...")
256261
origin_url = self.get_return_url(github_repository_id, change_request_id, installation_id)
257-
cla.log.debug(f"{fn} - Return URL from the inbound request is {origin_url}")
262+
cla.log.debug(f"{fn} - return URL resolved from inbound request")
258263
session["github_origin_url"] = origin_url
259-
cla.log.debug(f'{fn} - Stored origin url in session as session["github_origin_url"] = {origin_url}')
264+
cla.log.debug(f'{fn} - stored origin url in session')
260265

261266
if "github_oauth2_token" in session:
262267
cla.log.debug(f"{fn} - Using existing session GitHub OAuth2 token")
@@ -278,7 +283,7 @@ def _get_request_session(self, request) -> dict: # pylint: disable=no-self-use
278283
fn = "cla.models.github_models._get_request_session"
279284
session = request.context.get("session")
280285
if session is None:
281-
cla.log.warning(f"{fn} - Session is empty for request: {request}")
286+
cla.log.warning(f"{fn} - session is empty for request")
282287
session = {}
283288
request.context["session"] = session
284289

@@ -355,7 +360,7 @@ def oauth2_redirect(self, state, code, request): # pylint: disable=too-many-arg
355360
further requests and initiate the signing workflow.
356361
"""
357362
fn = "github_models.oauth2_redirect"
358-
cla.log.debug(f"{fn} - handling GitHub OAuth2 redirect with request: {dir(request)}")
363+
cla.log.debug(f"{fn} - handling GitHub OAuth2 redirect callback")
359364
session = self._get_request_session(request) # request.context['session']
360365

361366
if "github_oauth2_state" in session:
@@ -388,7 +393,7 @@ def oauth2_redirect(self, state, code, request): # pylint: disable=too-many-arg
388393
cla.log.debug(f"handling user-from-session callback")
389394
token_url = cla.conf["GITHUB_OAUTH_TOKEN_URL"]
390395
client_id = os.environ["GH_OAUTH_CLIENT_ID"]
391-
cla.log.debug(f"{fn} - using client ID {client_id[0:5]}...")
396+
cla.log.debug(f"{fn} - using configured GitHub OAuth client")
392397
client_secret = os.environ["GH_OAUTH_SECRET"]
393398
try:
394399
token = self._fetch_token(client_id, state, token_url, client_secret, code)
@@ -401,7 +406,7 @@ def oauth2_redirect(self, state, code, request): # pylint: disable=too-many-arg
401406
if user is None:
402407
cla.log.debug(f"{fn} - cannot find user, returning HTTP 404 status")
403408
else:
404-
cla.log.debug(f"{fn} - loaded user {user.to_dict()} returning HTTP 200 status")
409+
cla.log.debug(f"{fn} - loaded user returning HTTP 200 status")
405410
return user.to_dict()
406411

407412
# Get session information for this request.
@@ -414,11 +419,11 @@ def oauth2_redirect(self, state, code, request): # pylint: disable=too-many-arg
414419
token_url = cla.conf["GITHUB_OAUTH_TOKEN_URL"]
415420
client_id = os.environ["GH_OAUTH_CLIENT_ID"]
416421
client_secret = os.environ["GH_OAUTH_SECRET"]
417-
cla.log.debug(f"{fn} - fetching oauth2 token with client ID: {client_id[0:5]}..., token_url: {token_url}")
422+
cla.log.debug(f"{fn} - fetching oauth2 token from configured GitHub endpoint")
418423
token = self._fetch_token(client_id, state, token_url, client_secret, code)
419424
cla.log.debug(f"{fn} - oauth2 token received - storing token in session")
420425
session["github_oauth2_token"] = token
421-
cla.log.debug(f"{fn} - redirecting the user back to the console: {origin_url}")
426+
cla.log.debug(f"{fn} - redirecting the user back to the contributor console")
422427
return self.redirect_to_console(installation_id, github_repository_id, change_request_id, origin_url, request)
423428

424429
def redirect_to_console(self, installation_id, repository_id, pull_request_id, origin_url, request):

cla-backend/cla/utils.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,10 +1240,7 @@ def get_authorization_url_and_state(client_id, redirect_uri, scope, authorize_ur
12401240
if state is None:
12411241
oauth = OAuth2Session(client_id, redirect_uri=redirect_uri, scope=scope)
12421242
authorization_url, state = oauth.authorization_url(authorize_url)
1243-
cla.log.debug(
1244-
f"{fn} - initialized oauth session using the github oauth client id: {client_id[0:5]}... "
1245-
f"with the redirect_uri: {redirect_uri} and scope: {scope}"
1246-
)
1243+
cla.log.debug(f"{fn} - initialized oauth session for GitHub authorization flow")
12471244
return authorization_url, state
12481245
else:
12491246
csrf_token = secrets.token_urlsafe(16)
@@ -1254,10 +1251,7 @@ def get_authorization_url_and_state(client_id, redirect_uri, scope, authorize_ur
12541251
authorization_url, _ = oauth.authorization_url(authorize_url, state=encoded_state)
12551252

12561253
# Logging
1257-
cla.log.debug(
1258-
f"{fn} - initialized oauth session using the github oauth client id: {client_id[0:5]}... "
1259-
f"with the redirect_uri: {redirect_uri} and scope: {scope}"
1260-
)
1254+
cla.log.debug(f"{fn} - initialized oauth session for GitHub authorization flow with custom state")
12611255
return authorization_url, csrf_token
12621256

12631257

cla-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"shell-quote": "^1.7.3",
7777
"simple-git": "^3.32.3",
7878
"ws": ">=7.5.10",
79-
"tar": "^7.5.8",
79+
"tar": "^7.5.10",
8080
"xmlhttprequest-ssl": "^1.6.2",
8181
"fast-xml-parser": "^5.3.6",
8282
"ajv": "8.18.0",

cla-backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pydocusign==2.2
3333
PyGithub==1.55
3434
pyparsing==2.4.5
3535
PyJWT==2.11.0
36-
cryptography==41.0.7
36+
cryptography==46.0.5
3737
python-dateutil==2.8.1
3838
requests==2.31.0
3939
requests-oauthlib==1.2.0

cla-backend/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,7 +5494,7 @@ signal-exit@^3.0.2, signal-exit@^3.0.7:
54945494
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
54955495
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
54965496

5497-
simple-git@^3.16.0, simple-git@^3.23.3, simple-git@^3.32.3:
5497+
simple-git@^3.16.0, simple-git@^3.32.3:
54985498
version "3.32.3"
54995499
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.32.3.tgz#1dd6030fd03df4533a9e5a941314335e6265055d"
55005500
integrity sha512-56a5oxFdWlsGygOXHWrG+xjj5w9ZIt2uQbzqiIGdR/6i5iococ7WQ/bNPzWxCJdEUGUCmyMH0t9zMpRJTaKxmw==
@@ -5770,10 +5770,10 @@ tar-stream@^2.1.0, tar-stream@^2.2.0:
57705770
inherits "^2.0.3"
57715771
readable-stream "^3.1.1"
57725772

5773-
tar@^6.1.15, tar@^7.5.8:
5774-
version "7.5.9"
5775-
resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.9.tgz#817ac12a54bc4362c51340875b8985d7dc9724b8"
5776-
integrity sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==
5773+
tar@^6.1.15, tar@^7.5.10:
5774+
version "7.5.11"
5775+
resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.11.tgz#1250fae45d98806b36d703b30973fa8e0a6d8868"
5776+
integrity sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ==
57775777
dependencies:
57785778
"@isaacs/fs-minipass" "^4.0.0"
57795779
chownr "^3.0.0"

0 commit comments

Comments
 (0)