Skip to content

Commit d610bef

Browse files
committed
refactor: remove widget plugins from the main package
1 parent ac1e619 commit d610bef

18 files changed

+141
-22
lines changed

MIGRATION-v2.3.0.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Migrating to Version 2.3.0
2+
3+
## Summary
4+
5+
A reported vulnerability, [CVE-2025-65849](https://www.cve.org/CVERecord?id=CVE-2025-65849), is currently marked as *disputed* but is still flagged by vulnerability scanners such as `npm audit`.
6+
As a result, version **2.3.0** moves the obfuscation and other plugins out of the main package into a new package: `@altcha/plugins`.
7+
8+
## Installation
9+
10+
If you use any plugins (such as obfuscation), install the new package explicitly:
11+
12+
```bash
13+
npm install @altcha/plugins
14+
```
15+
16+
If you do **not** use any plugins, no additional installation or code changes are required.
17+
18+
## Migration Steps
19+
20+
Plugins are no longer bundled with the main package and must be imported explicitly from `@altcha/plugins`.
21+
22+
**Before (≤ 2.2.4):**
23+
24+
```js
25+
import 'altcha/obfuscation';
26+
import 'altcha';
27+
```
28+
29+
**After (≥ 2.3.0):**
30+
31+
```js
32+
import '@altcha/plugins/obfuscation';
33+
import 'altcha';
34+
```
35+
36+
If you are not importing any plugins, your existing setup continues to work unchanged.
37+
38+
## Rationale
39+
40+
The reported issue describes a cryptographic limitation (an algebraic bypass) of the AES-GCM authentication mechanism, not an exploitable vulnerability in the widget itself. This limitation cannot be mitigated within the widget’s scope.
41+
42+
To prevent false-positive reports in tools like `npm audit`, the affected obfuscation plugin has been extracted into a separate package. If you do not use obfuscation, version 2.3.0 removes the problematic code entirely. If you do use it, you must accept the documented limitations:
43+
44+
[https://altcha.org/docs/v2/obfuscation/#complexity-and-automation](https://altcha.org/docs/v2/obfuscation/#complexity-and-automation)
45+
46+
Additional context:
47+
[https://github.com/github/advisory-database/pull/6536#issuecomment-3645647102](https://github.com/github/advisory-database/pull/6536#issuecomment-3645647102)

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ ALTCHA is fully compliant with:
99

1010
For more details, visit [altcha.org](https://altcha.org).
1111

12+
> [!NOTE]
13+
> **Breaking change (v2.3.0)**
14+
>
15+
> As of version **2.3.0**, the obfuscation and other plugins have been removed from the main package and moved to a separate package: `@altcha/plugins`.
16+
>
17+
> If you do not use any plugins, no changes are required.
18+
>
19+
> See the [migration guide for v2.3.0](https://github.com/altcha-org/altcha/blob/main/MIGRATION-v2.3.0.md).
20+
21+
1222
## Features
1323

1424
- **Frictionless Experience**: Uses proof-of-work (PoW) instead of visual puzzles for a seamless user experience.
@@ -60,7 +70,7 @@ Explore starter templates for popular frameworks:
6070

6171
## Plugins & CMS
6272

63-
- [Libraries and plugins](https://altcha.org/docs/integrations/)
73+
- [Libraries and plugins](https://altcha.org/docs/v2/libraries/)
6474

6575
## Usage
6676

@@ -103,11 +113,11 @@ Or load via `<script>` tag:
103113
</form>
104114
```
105115

106-
See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/website-integration).
116+
See [configuration options](#configuration) or the [website integration docs](https://altcha.org/docs/v2/widget-integration).
107117

108118
### 3. Integrate with Your Server
109119

110-
Refer to the [server documentation](https://altcha.org/docs/server-integration) for implementation details.
120+
Refer to the [server documentation](https://altcha.org/docs/v2/server-integration) for implementation details.
111121

112122
## Supported Browsers
113123

@@ -141,7 +151,7 @@ When GZIPped, it totals about 30 kB, making ALTCHA’s widget about 90% smaller
141151

142152
## Content Security Policy (CSP)
143153

144-
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist_external`. Learn more in the [documentation](https://altcha.org/docs/website-integration).
154+
The default bundle includes styles and workers in a single file. For strict CSP compliance, use scripts from `/dist_external`. Learn more in the [documentation](https://altcha.org/docs/v2/widget-integration).
145155

146156
## Configuration
147157

@@ -172,14 +182,14 @@ Additional options:
172182
- **name**: Name of the hidden field containing the payload (defaults to "altcha").
173183
- **overlay**: Enables overlay UI mode (automatically sets `auto="onsubmit"`).
174184
- **overlaycontent**: CSS selector of the HTML element to display in the overlay modal before the widget.
175-
- **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/widget-customization).
185+
- **strings**: JSON-encoded translation strings. Refer to [customization](https://altcha.org/docs/v2/widget-customization).
176186
- **verifyurl**: URL for server-side verification requests. This option is automatically configured with Sentinel. Override this setting only if using a custom server implementation. Supports `fn:function_name` format to call a global JS function instead.
177187
- **workers**: Number of workers to utilize for PoW (defaults to `navigator.hardwareConcurrency || 8`, max value `16`).
178188
- **workerurl**: URL of the Worker script (defaults to `./worker.js`, only works with `external` build).
179189

180190
Data Obfuscation options:
181191

182-
- **obfuscated**: The [obfuscated data](https://altcha.org/docs/obfuscation) provided as a base64-encoded string (requires `altcha/obfuscation` plugin). Use only without `challengeurl`/`challengejson`.
192+
- **obfuscated**: The [obfuscated data](https://altcha.org/docs/v2/obfuscation) provided as a base64-encoded string (requires `altcha/obfuscation` plugin). Use only without `challengeurl`/`challengejson`.
183193

184194
Development / Testing options:
185195

package.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"files": [
3838
"dist",
3939
"dist_external",
40-
"dist_plugins",
4140
"dist_i18n"
4241
],
4342
"main": "./dist/altcha.umd.cjs",
@@ -52,18 +51,6 @@
5251
"import": "./dist_external/altcha.css",
5352
"require": "./dist_external/altcha.css"
5453
},
55-
"./analytics": {
56-
"import": "./dist_plugins/analytics.js",
57-
"require": "./dist_plugins/analytics.umd.cjs"
58-
},
59-
"./obfuscation": {
60-
"import": "./dist_plugins/obfuscation.js",
61-
"require": "./dist_plugins/obfuscation.umd.cjs"
62-
},
63-
"./upload": {
64-
"import": "./dist_plugins/upload.js",
65-
"require": "./dist_plugins/upload.umd.cjs"
66-
},
6754
"./external": {
6855
"import": "./dist_external/altcha.js",
6956
"require": "./dist_external/altcha.umd.cjs"
@@ -83,10 +70,9 @@
8370
},
8471
"scripts": {
8572
"dev": "vite",
86-
"build": "npm run build:bundle && npm run build:external && npm run build:plugins && npm run build:i18n",
73+
"build": "npm run build:bundle && npm run build:external && npm run build:i18n",
8774
"build:bundle": "rimraf dist && vite build && vite build -c vite.bundle-i18n.config.ts && cp src/declarations.d.ts dist/altcha.d.ts && cp src/declarations.d.ts dist/altcha.i18n.d.ts",
8875
"build:external": "rimraf dist_external && vite build -c vite.external.config.ts && cp src/declarations.d.ts dist_external/altcha.d.ts",
89-
"build:plugins": "rimraf dist_plugins && find src/plugins -type f -name '*.ts' | xargs -I {} vite build -c vite.plugins.config.ts -- {}",
9076
"build:i18n": "rimraf dist_i18n && find src/i18n -type f -name '*.ts' | xargs -I {} vite build -c vite.i18n.config.ts -- {}",
9177
"preview": "vite preview",
9278
"check": "svelte-check --tsconfig ./tsconfig.json",

plugins/dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'altcha/index';

plugins/dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

plugins/dist/index.umd.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict"});

0 commit comments

Comments
 (0)