Skip to content

Commit ca8c963

Browse files
authored
Merge pull request #798 from BC-SECURITY/release/6.2.1
v6.2.1 into main
2 parents dcf735f + f2deda9 commit ca8c963

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
## [Unreleased]
1616

17+
## [6.2.1] - 2025-09-05
18+
19+
- Fix bug where websocket connection would fail because the jwt_auth method arguments changed
20+
1721
## [6.2.0] - 2025-09-02
1822

1923
- Updated Starkiller to v3.1.0
@@ -1152,7 +1156,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11521156
- Updated shellcoderdi to newest version (@Cx01N)
11531157
- Added a Nim launcher (@Hubbl3)
11541158

1155-
[Unreleased]: https://github.com/BC-SECURITY/Empire-Sponsors/compare/v6.2.0...HEAD
1159+
[Unreleased]: https://github.com/BC-SECURITY/Empire-Sponsors/compare/v6.2.1...HEAD
1160+
1161+
[6.2.1]: https://github.com/BC-SECURITY/Empire-Sponsors/compare/v6.2.0...v6.2.1
11561162

11571163
[6.2.0]: https://github.com/BC-SECURITY/Empire-Sponsors/compare/v6.1.4...v6.2.0
11581164

empire/server/api/jwt_auth.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ def get_token_from_headers(request: Request) -> str:
9090
)
9191

9292

93-
async def get_current_user(
93+
async def get_current_user_from_token(
9494
db: CurrentSession,
95-
request: Request,
95+
token: str,
9696
):
9797
credentials_exception = HTTPException(
9898
status_code=status.HTTP_401_UNAUTHORIZED,
@@ -101,7 +101,6 @@ async def get_current_user(
101101
)
102102

103103
try:
104-
token = get_token_from_headers(request)
105104
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
106105
username: str = payload.get("sub")
107106
if username is None:
@@ -118,6 +117,14 @@ async def get_current_user(
118117
return user
119118

120119

120+
async def get_current_user(
121+
db: CurrentSession,
122+
request: Request,
123+
):
124+
token = get_token_from_headers(request)
125+
return await get_current_user_from_token(db, token)
126+
127+
121128
CurrentUser = Annotated[models.User, Depends(get_current_user)]
122129

123130

empire/server/api/v2/websocket/socketio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setup_socket_events(sio, empire_menu): # noqa: PLR0915
3131
sid_to_user = {}
3232

3333
async def get_user_from_token(sid, token, db: Session):
34-
user = await jwt_auth.get_current_user(db, token)
34+
user = await jwt_auth.get_current_user_from_token(db, token)
3535
if user is None:
3636
return False
3737
sid_to_user[sid] = user.id

empire/server/common/empire.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
if TYPE_CHECKING:
3535
from socket import SocketIO
3636

37-
VERSION = "6.2.0 BC Security Fork"
37+
VERSION = "6.2.1 BC Security Fork"
3838

3939
log = logging.getLogger(__name__)
4040

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "empire-bc-security-fork"
3-
version = "6.2.0"
3+
version = "6.2.1"
44
description = ""
55
authors = ["BC Security <info@bc-security.org>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)