Skip to content

Commit 2229986

Browse files
committed
fix: limit joined_at to seconds up to 01/01/2100
1 parent b3b1b21 commit 2229986

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"main": "index.js",
33
"name": "libsession_util_nodejs",
44
"description": "Wrappers for the Session Util Library",
5-
"version": "0.4.7",
5+
"version": "0.4.8",
66
"license": "GPL-3.0",
77
"author": {
88
"name": "Oxen Project",

src/user_groups_config.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ Napi::Value UserGroupsWrapper::setGroup(const Napi::CallbackInfo& info) {
314314
obj.Get("joinedAtSeconds"), "UserGroupsWrapper::setGroup joinedAtSeconds")) {
315315
group_info.joined_at = *joinedAtSeconds;
316316
}
317+
// 1st Jan 2100. Probably an invalid timestamp.
318+
if (group_info.joined_at > 4099680000) {
319+
throw std::invalid_argument{"group.joined_at is too far in the future"};
320+
}
317321

318322
if (auto invited = maybeNonemptyBoolean(
319323
obj.Get("invitePending"), "UserGroupsWrapper::setGroup invitePending")) {

0 commit comments

Comments
 (0)