wrec 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -162,6 +162,28 @@ Wrec looks for this automatically does the rest of the work.
162
162
  static formAssociated = true;
163
163
  ```
164
164
 
165
+ ## Security
166
+
167
+ Wrec uses the JavaScript `eval` function to evaluate JavaScript expressions
168
+ that are placed in attribute values and the text content of elements.
169
+ This has security implications
170
+ if those expressions can come from untrusted sources.
171
+
172
+ Perhaps the most dangerous thing this allows
173
+ is sending HTTP requests to other servers.
174
+ Such requests could contain data from your web app
175
+ in order to share it with unscrupulous sites.
176
+
177
+ The easiest way to prevent this is to add a
178
+ Content Security Policy (CSP) to your web app.
179
+ Simply adding the following element as a child of the
180
+ `head` element in each page blocks sending HTTP requests
181
+ to any domain except that of your web app:
182
+
183
+ ```html
184
+ <meta http-equiv="Content-Security-Policy" content="connect-src 'self'" />
185
+ ```
186
+
165
187
  ## More Examples
166
188
 
167
189
  Check out the web app in the `demo` directory.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wrec",
3
3
  "author": "R. Mark Volkmann",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",