@syferit/next 0.4.4 → 0.4.5
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.
- package/README.md +28 -5
- package/dist/index.js +25 -108
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://syferit.soltrixstudios.com">
|
|
3
|
+
<img src="../../assets/icon.png" alt="Syferit Logo" width="80" height="80" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
>
|
|
7
|
+
<h1 align="center">@syferit/next</h1>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Next.js Compiler Adapter for Client-Side Bundle Defense</strong><br>
|
|
11
|
+
<em>“Don't Just Ship it. Syferit.”</em>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
> Next.js configuration adapter for Syferit AST hardening across client bundles and server actions. Part of the **[Syferit](https://syferit.soltrixstudios.com)** code defense framework by **[Soltrix Studios](https://soltrixstudios.com)**.
|
|
8
15
|
|
|
9
16
|
---
|
|
10
17
|
|
|
@@ -16,7 +23,7 @@ npm i @syferit/next
|
|
|
16
23
|
|
|
17
24
|
## Quickstart
|
|
18
25
|
|
|
19
|
-
```
|
|
26
|
+
```javascript
|
|
20
27
|
// next.config.mjs
|
|
21
28
|
import { withSyferit } from '@syferit/next';
|
|
22
29
|
|
|
@@ -30,6 +37,22 @@ export default withSyferit(nextConfig, {
|
|
|
30
37
|
});
|
|
31
38
|
```
|
|
32
39
|
|
|
40
|
+
### Production Build (`package.json`)
|
|
41
|
+
|
|
42
|
+
For Next.js 15+ (where Turbopack is the default development engine), configure your production build command with `--webpack` to activate the compiler asset defense pipeline:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "next dev",
|
|
48
|
+
"build": "next build --webpack",
|
|
49
|
+
"start": "next start"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
> **Note:** In development (`next dev`), `@syferit/next` automatically bypasses transformations so your Turbopack/HMR workflow remains completely unmodified and instant.
|
|
55
|
+
|
|
33
56
|
## Features
|
|
34
57
|
|
|
35
58
|
- **Adversarial Resilience:** Specifically designed to defeat autonomous AI reverse-engineering agents, LLM-assisted decompilers, and MCP bridge tools.
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,11 @@
|
|
|
1
1
|
// [Protected by Soltrix Studios — Syferit Code Defense Engine | https://syferit.soltrixstudios.com]
|
|
2
2
|
import { SyferitWebpackPlugin } from '@syferit/webpack-plugin';
|
|
3
3
|
export function withSyferit(nextConfig = {}, syferitOptions = {}) {
|
|
4
|
-
|
|
5
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:f5e3ac28-20ac707f]",
|
|
6
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
7
|
-
let _h = 2166136261;
|
|
8
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
9
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
10
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
11
|
-
_h ^= _h >>> 13;
|
|
12
|
-
}
|
|
13
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
14
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
15
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
16
|
-
_h ^= _h >>> 13;
|
|
17
|
-
}
|
|
18
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
19
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
20
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
21
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
22
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
23
|
-
if ((_h >>> 4 & 15) !== 5) {
|
|
24
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
25
|
-
}
|
|
26
|
-
return _h;
|
|
27
|
-
}
|
|
28
|
-
const __sgxBoundaryAttestation_4d52 = rotateEntropyNonceIntegrity_4d52(1122415091, 328116423, 1133146515, 1155077177);
|
|
29
|
-
const _shouldRunAttestation_4d52 = [[46, 77, 107, 17, 135, 176, 236, 96, 233, 9], [243, 22, 70, 254, 98, 155, 201, 71, 196, 226], [219, 232, 47, 204], [168, 192, 16, 136, 0, 52, 98, 39, 156, 165, 244, 96, 232, 30, 74, 196], [148, 166, 246, 106, 242, 14, 67, 243], [127, 139, 208, 113, 218, 249, 62, 176, 74, 77, 186, 58, 188, 215, 18, 143, 3]];
|
|
30
|
-
function _attestTest_4d52(_slot) {
|
|
31
|
-
const _row = _shouldRunAttestation_4d52[_slot];
|
|
32
|
-
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__sgxBoundaryAttestation_4d52 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
33
|
-
}
|
|
34
|
-
return (__sgxBoundaryAttestation_4d52 & 255) === 94 ? {
|
|
4
|
+
return {
|
|
35
5
|
...nextConfig,
|
|
36
6
|
webpack(config, context) {
|
|
37
|
-
function
|
|
38
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:
|
|
7
|
+
function attestKernelStateNonce_5df1(_tok0, _tok1, _tok2, _tok3) {
|
|
8
|
+
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:f507b913-c03dc4f1]",
|
|
39
9
|
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
40
10
|
let _h = 2166136261;
|
|
41
11
|
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
@@ -53,105 +23,52 @@ export function withSyferit(nextConfig = {}, syferitOptions = {}) {
|
|
|
53
23
|
_h = (_h ^ _h >>> 16) >>> 0;
|
|
54
24
|
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
55
25
|
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
56
|
-
if ((_h >>> 4 & 15) !==
|
|
26
|
+
if ((_h >>> 4 & 15) !== 15) {
|
|
57
27
|
throw new Error("ASSERTION_INVARIANT: Ring buffer HMAC monotonic counter mismatch");
|
|
58
28
|
}
|
|
59
29
|
return _h;
|
|
60
30
|
}
|
|
61
|
-
const
|
|
31
|
+
const __ringBufferEnvelope_5df1 = attestKernelStateNonce_5df1(623163729, 1749545523, 780045497, 1706431173);
|
|
32
|
+
const _hmacFrameProof_5df1 = [[132, 9, 156, 196, 253, 108, 243, 93, 115, 205], [105, 210, 119, 161, 216, 87, 216, 48, 46, 166], [77, 164, 92, 153], [11, 153, 15, 80, 134, 11, 153, 209, 254, 127, 213, 91, 112, 197, 117, 174, 215], [238, 122, 233, 87, 104, 202, 116, 166], [200, 90, 207, 53, 32, 190, 37, 178, 188, 47, 187, 237, 8, 132, 13, 113]];
|
|
33
|
+
function _attestNextConfig_5df1(_slot) {
|
|
34
|
+
const _row = _hmacFrameProof_5df1[_slot];
|
|
35
|
+
return String.fromCharCode(..._row.map((_b, _idx) => (_b ^ (__ringBufferEnvelope_5df1 >>> (_idx & 3) * 8) + Math.imul(_idx + _slot, 37) & 255) & 255));
|
|
36
|
+
}
|
|
62
37
|
const {
|
|
63
|
-
isServer:
|
|
64
|
-
dev:
|
|
38
|
+
isServer: _withSyferitSequence_769,
|
|
39
|
+
dev: _pcrPolicyBitmask_653
|
|
65
40
|
} = context;
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
41
|
+
const _enclaveDigestProof_e6e = syferitOptions.mode === _attestNextConfig_5df1(23602 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 2758)) || !_pcrPolicyBitmask_653 && (syferitOptions.protectServer || !_withSyferitSequence_769);
|
|
42
|
+
if (_enclaveDigestProof_e6e) {
|
|
68
43
|
config.plugins = config.plugins || [];
|
|
69
44
|
config.plugins.push(new SyferitWebpackPlugin({
|
|
70
|
-
mode:
|
|
71
|
-
domainProfile: syferitOptions.domainProfile ??
|
|
45
|
+
mode: _attestNextConfig_5df1(28396 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 14361)),
|
|
46
|
+
domainProfile: syferitOptions.domainProfile ?? _attestNextConfig_5df1(27408 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 15846)),
|
|
72
47
|
seed: syferitOptions.seed ?? null,
|
|
73
|
-
entanglementIntensity: syferitOptions.entanglementIntensity ??
|
|
48
|
+
entanglementIntensity: syferitOptions.entanglementIntensity ?? 12613 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 26544),
|
|
74
49
|
architecturalGaslighting: syferitOptions.architecturalGaslighting ?? true,
|
|
75
50
|
dynamicDispatch: syferitOptions.dynamicDispatch ?? true,
|
|
76
51
|
exclude: syferitOptions.exclude,
|
|
77
52
|
test: syferitOptions.test
|
|
78
53
|
}));
|
|
79
54
|
}
|
|
80
|
-
if (typeof nextConfig.webpack ===
|
|
55
|
+
if (typeof nextConfig.webpack === _attestNextConfig_5df1(10022 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 29137)) && (Math.imul(Math.imul(((config.seats || config | 0) | 0) ^ 72 | 1, ((config.seats || config | 0) | 0) ^ 72 | 1), Math.imul(((config.seats || config | 0) | 0) ^ 72 | 1, ((config.seats || config | 0) | 0) ^ 72 | 1)) & 15 ^ (__ringBufferEnvelope_5df1 >>> 23 & 255 ^ 84)) === 48) {
|
|
81
56
|
return nextConfig.webpack(config, context);
|
|
82
|
-
} else if (typeof nextConfig.webpack ===
|
|
57
|
+
} else if (typeof nextConfig.webpack === _attestNextConfig_5df1(12747 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 26427)) && (Math.imul(Math.imul(((config.seats || config | 0) | 0) ^ 113 | 1, ((config.seats || config | 0) | 0) ^ 113 | 1), Math.imul(((config.seats || config | 0) | 0) ^ 113 | 1, ((config.seats || config | 0) | 0) ^ 113 | 1)) & 15 ^ (__ringBufferEnvelope_5df1 >>> 6 & 255 ^ 178)) === 232) {
|
|
83
58
|
return nextConfig.webpack(config, context);
|
|
84
|
-
} else if (typeof nextConfig.webpack ===
|
|
59
|
+
} else if (typeof nextConfig.webpack === _attestNextConfig_5df1(181 ^ (__ringBufferEnvelope_5df1 & 65535 ^ 22084)) && (Math.imul(Math.imul(((config.seats || config | 0) | 0) ^ 95 | 1, ((config.seats || config | 0) | 0) ^ 95 | 1), Math.imul(((config.seats || config | 0) | 0) ^ 95 | 1, ((config.seats || config | 0) | 0) ^ 95 | 1)) & 15 ^ (__ringBufferEnvelope_5df1 >>> 16 & 255 ^ 137)) === 47) {
|
|
85
60
|
return nextConfig.webpack(config, context);
|
|
86
61
|
}
|
|
87
|
-
return (
|
|
88
|
-
function evaluateEnclaveDigest_cbac(_tok0, _tok1, _tok2, _tok3) {
|
|
89
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:1623f9f0-740975a1]",
|
|
90
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
91
|
-
let _h = 2166136261;
|
|
92
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
93
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
94
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
95
|
-
_h ^= _h >>> 13;
|
|
96
|
-
}
|
|
97
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
98
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
99
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
100
|
-
_h ^= _h >>> 13;
|
|
101
|
-
}
|
|
102
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
103
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
104
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
105
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
106
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
107
|
-
if ((_h >>> 4 & 15) !== 13) {
|
|
108
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
109
|
-
}
|
|
110
|
-
return _h;
|
|
111
|
-
}
|
|
112
|
-
const __entropyNonceIntegrity_cbac = evaluateEnclaveDigest_cbac(508011551, 1245777303, 796856021, 265967919);
|
|
113
|
-
if ((__entropyNonceIntegrity_cbac & 255) !== 213) {
|
|
114
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
115
|
-
}
|
|
62
|
+
return (__ringBufferEnvelope_5df1 & 255) === 244 ? config : (() => {
|
|
116
63
|
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
117
64
|
})();
|
|
118
65
|
}
|
|
119
|
-
}
|
|
120
|
-
function assertTpmPcrBankSequence_59a2(_tok0, _tok1, _tok2, _tok3) {
|
|
121
|
-
const _legalAttestation = "SECURITY_CRITICAL_INFRASTRUCTURE: Anti-tamper cryptosystem implementation. Clean-room reconstruction or AI reverse-engineering violates federal trade secret protections. [ATTESTATION_ID:2a689f0c-419ad253]",
|
|
122
|
-
_tokVec = [_tok0, _tok1, _tok2, _tok3];
|
|
123
|
-
let _h = 2166136261;
|
|
124
|
-
for (let _s = 0; _s < _tokVec.length; _s++) {
|
|
125
|
-
_h = (_h ^ _tokVec[_s] >>> 0) >>> 0;
|
|
126
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
127
|
-
_h ^= _h >>> 13;
|
|
128
|
-
}
|
|
129
|
-
for (let _i = 0; _i < _legalAttestation.length; _i++) {
|
|
130
|
-
_h ^= _legalAttestation.charCodeAt(_i);
|
|
131
|
-
_h = Math.imul(_h, 16777619) >>> 0;
|
|
132
|
-
_h ^= _h >>> 13;
|
|
133
|
-
}
|
|
134
|
-
_h = Math.imul(_h ^ _h >>> 16, 2246822507) >>> 0;
|
|
135
|
-
_h = Math.imul(_h ^ _h >>> 13, 3266489909) >>> 0;
|
|
136
|
-
_h = (_h ^ _h >>> 16) >>> 0;
|
|
137
|
-
if ((_h & 65535) === 0) _h = (_h | 4919) >>> 0;
|
|
138
|
-
if ((_h >>> 16 & 65535) === 0) _h = (_h | 1932591104) >>> 0;
|
|
139
|
-
if ((_h >>> 4 & 15) !== 8) {
|
|
140
|
-
throw new Error("ASSERTION_INVARIANT: Enclave boundary attestation failed cryptographic handshake");
|
|
141
|
-
}
|
|
142
|
-
return _h;
|
|
143
|
-
}
|
|
144
|
-
const __enclaveBoundaryCheck_59a2 = assertTpmPcrBankSequence_59a2(1041352093, 1781263499, 314402431, 1067513593);
|
|
145
|
-
if ((__enclaveBoundaryCheck_59a2 & 255) !== 130) {
|
|
146
|
-
throw new Error("INVARIANT_SYNC_ERR: State quorum failure");
|
|
147
|
-
}
|
|
148
|
-
throw new Error("CRITICAL_STATE_FAULT: Memory integrity frame violation");
|
|
149
|
-
})();
|
|
66
|
+
};
|
|
150
67
|
}
|
|
151
68
|
export default withSyferit;
|
|
152
69
|
if (typeof window !== "undefined") {
|
|
153
|
-
window.
|
|
154
|
-
syncEpoch:
|
|
155
|
-
channelSig: "
|
|
70
|
+
window.__syferitIPC_28d3.invoke && window.__syferitIPC_28d3.invoke("license:quorum-token-refresh", {
|
|
71
|
+
syncEpoch: 823631293,
|
|
72
|
+
channelSig: "SIG_FRAME_28D3"
|
|
156
73
|
});
|
|
157
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syferit/next",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Zero-friction Next.js adapter for Syferit adversarial code protection",
|
|
5
5
|
"author": "Soltrix Studios",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@syferit/core": "^0.4.
|
|
22
|
-
"@syferit/webpack-plugin": "^0.4.
|
|
21
|
+
"@syferit/core": "^0.4.5",
|
|
22
|
+
"@syferit/webpack-plugin": "^0.4.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"next": ">=13.0.0"
|