Skip to content

Commit 5122808

Browse files
committedSep 10, 2021
Remove forge.debug API.
The API has the potential for prototype pollution. This API was only briefly used by the maintainers for internal project debug purposes and was never inteneded to be used with untrusted user intputs. This API was not documented or advertised and is being removed rather than fixed.
1 parent 5d09946 commit 5122808

File tree

6 files changed

+5
-108
lines changed

6 files changed

+5
-108
lines changed
 

‎CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Forge ChangeLog
44
## 0.11.0 - 2021-xx-xx
55

66
### Removed
7+
- **SECURITY**, **BREAKING**: Remove `forge.debug` API. The API has the
8+
potential for prototype pollution. This API was only briefly used by the
9+
maintainers for internal project debug purposes and was never inteneded to be
10+
used with untrusted user intputs. This API was not documented or advertised
11+
and is being removed rather than fixed.
712
- **BREAKING**: Remove `forge.task` API. This API was never used, documented,
813
or advertised by the maintainers. If anyone was using this API and wishes to
914
continue development it in other project, please let the maintainers know.

‎README.md

-14
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ Documentation
8080
* [Tasks](#task)
8181
* [Utilities](#util)
8282
* [Logging](#log)
83-
* [Debugging](#debug)
8483
* [Flash Networking Support](#flash)
8584

8685
### Other
@@ -1988,19 +1987,6 @@ __Examples__
19881987
// TODO
19891988
```
19901989

1991-
<a name="debug" />
1992-
1993-
### Debugging
1994-
1995-
Provides storage of debugging information normally inaccessible in
1996-
closures for viewing/investigation.
1997-
1998-
__Examples__
1999-
2000-
```js
2001-
// TODO
2002-
```
2003-
20041990
<a name="flash" />
20051991

20061992
### Flash Networking Support

‎lib/debug.js

-78
This file was deleted.

‎lib/http.js

-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* Copyright (c) 2010-2014 Digital Bazaar, Inc. All rights reserved.
77
*/
88
var forge = require('./forge');
9-
require('./debug');
109
require('./tls');
1110
require('./util');
1211

@@ -16,11 +15,6 @@ var http = module.exports = forge.http = forge.http || {};
1615
// logging category
1716
var cat = 'forge.http';
1817

19-
// add array of clients to debug storage
20-
if(forge.debug) {
21-
forge.debug.set('forge.http', 'clients', []);
22-
}
23-
2418
// normalizes an http header field name
2519
var _normalize = function(name) {
2620
return name.toLowerCase().replace(/(^.)|(-.)/g,
@@ -484,11 +478,6 @@ http.createClient = function(options) {
484478
true : options.persistCookies
485479
};
486480

487-
// add client to debug storage
488-
if(forge.debug) {
489-
forge.debug.get('forge.http', 'clients').push(client);
490-
}
491-
492481
// load cookies from disk
493482
_loadCookies(client);
494483

‎lib/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require('./aes');
1010
require('./aesCipherSuites');
1111
require('./asn1');
1212
require('./cipher');
13-
require('./debug');
1413
require('./des');
1514
require('./ed25519');
1615
require('./hmac');

‎tests/support/task.js

-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ var sVL = 0;
2424
// track tasks for debugging
2525
var sTasks = {};
2626
var sNextTaskId = 0;
27-
// debug access
28-
forge.debug.set(cat, 'tasks', sTasks);
2927

3028
// a map of task type to task queue
3129
var sTaskQueues = {};
32-
// debug access
33-
forge.debug.set(cat, 'queues', sTaskQueues);
3430

3531
// name for unnamed tasks
3632
var sNoTaskName = '?';

0 commit comments

Comments
 (0)
Please sign in to comment.