diff --git a/keyserver/src/responders/landing-handler.js b/keyserver/src/responders/landing-handler.js
--- a/keyserver/src/responders/landing-handler.js
+++ b/keyserver/src/responders/landing-handler.js
@@ -13,6 +13,7 @@
isValidPrimaryIdentityPublicKey,
isValidSIWENonce,
isValidSIWEMessageType,
+ isValidSIWEIssuedAt,
} from 'lib/utils/siwe-utils.js';
import { getMessageForException } from './utils.js';
@@ -153,6 +154,18 @@
}
const siweMessageType = ((siweMessageTypeRawString: any): SIWEMessageType);
+ const siweMessageIssuedAt = req.header('siwe-message-issued-at');
+ if (
+ siweMessageIssuedAt !== null &&
+ siweMessageIssuedAt !== undefined &&
+ !isValidSIWEIssuedAt(siweMessageIssuedAt)
+ ) {
+ res.status(400).send({
+ message: 'Invalid siwe message issued at.',
+ });
+ return;
+ }
+
const [{ jsURL, fontURLs, cssInclude }, LandingSSR] = await Promise.all([
getAssetInfo(),
getWebpackCompiledRootComponentForSSR(),
@@ -215,6 +228,7 @@
siweNonce={siweNonce}
siwePrimaryIdentityPublicKey={siwePrimaryIdentityPublicKey}
siweMessageType={siweMessageType}
+ siweMessageIssuedAt={siweMessageIssuedAt}
/>,
);
reactStream.pipe(res, { end: false });
@@ -227,12 +241,16 @@
const siweMessageTypeString = siweMessageType
? `"${siweMessageType}"`
: 'null';
+ const siweMessageIssuedAtString = siweMessageIssuedAt
+ ? `"${siweMessageIssuedAt}"`
+ : 'null';
// prettier-ignore
res.end(html`
+