@riocrypto/common-server 1.0.2938 → 1.0.2939

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -143,20 +143,22 @@ class LoggerService {
143
143
  headers[headerKey] = this.maskValue(String(headers[headerKey]));
144
144
  }
145
145
  });
146
- // Mask cookies specifically
146
+ // Every cookie value is treated as a credential. An allowlist of names
147
+ // drifted out of date when admin-google-session was added, and the
148
+ // cookie name alone is enough to see which sessions a request carried.
149
+ // Split on the first "=" only, since base64 values may contain padding.
147
150
  if (headers.cookie) {
148
- headers.cookie = headers.cookie
151
+ headers.cookie = String(headers.cookie)
149
152
  .split("; ")
150
153
  .map((cookie) => {
151
- const [key, value] = cookie.split("=");
152
- if (key === "accessToken" ||
153
- key === "adminAccessToken" ||
154
- key === "refreshToken" ||
155
- key === "adminRefreshToken" ||
156
- key === "phoneVerifiedJWT") {
157
- return `${key}=${this.maskValue(value, true)}`;
158
- }
159
- return cookie;
154
+ const separator = cookie.indexOf("=");
155
+ if (separator === -1)
156
+ return cookie;
157
+ const key = cookie.slice(0, separator);
158
+ const value = cookie.slice(separator + 1);
159
+ if (value === "")
160
+ return cookie;
161
+ return `${key}=${this.maskValue(value, true)}`;
160
162
  })
161
163
  .join("; ");
162
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2938",
3
+ "version": "1.0.2939",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",