Skip to content

Commit 3a23d15

Browse files
Security: fix CodeQL alerts (#22)
1 parent 6ef3edc commit 3a23d15

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

.github/workflows/asset-size.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
compare:
77
timeout-minutes: 15
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
pull-requests: write
912

1013
steps:
1114
- uses: actions/checkout@v4

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
test:
1111
timeout-minutes: 10
1212
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
13+
permissions:
14+
contents: read
1315
strategy:
1416
fail-fast: false
1517
matrix:
@@ -39,6 +41,8 @@ jobs:
3941
timeout-minutes: 15
4042
name: Measure performance impact of changes
4143
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
4246

4347
steps:
4448
- uses: actions/checkout@v4
@@ -55,6 +59,8 @@ jobs:
5559
timeout-minutes: 15
5660
name: Ensure typescript compatibility
5761
runs-on: ubuntu-latest
62+
permissions:
63+
contents: read
5864

5965
steps:
6066
- uses: actions/checkout@v4

lib/utils/col-cache.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,30 @@ const colCache = {
214214

215215
// convert [sheetName!][$]col[$]row[[$]col[$]row] into address or range structures
216216
decodeEx(value) {
217-
const groups = value.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/);
217+
let sheetName;
218+
let reference = value;
218219

219-
const sheetName = groups[1] || groups[2]; // Qouted and unqouted groups
220-
const reference = groups[3]; // Remaining address
220+
if (value.startsWith('\'')) {
221+
for (let i = 1; i < value.length; i++) {
222+
if (value[i] === '\'') {
223+
if (i + 1 < value.length && value[i + 1] === '\'') {
224+
i++;
225+
continue;
226+
}
227+
if (i + 1 < value.length && value[i + 1] === '!') {
228+
sheetName = value.slice(1, i).replace(/''/g, '\'');
229+
reference = value.slice(i + 2);
230+
}
231+
break;
232+
}
233+
}
234+
} else {
235+
const bang = value.indexOf('!');
236+
if (bang > 0) {
237+
sheetName = value.slice(0, bang);
238+
reference = value.slice(bang + 1);
239+
}
240+
}
221241

222242
const parts = reference.split(':');
223243
if (parts.length > 1) {

spec/manual/public/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Browserify</title>
6-
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.js"></script>
6+
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.js"
7+
integrity="sha512-w+OmM1I6bMDUnX5zLWiRiV+3KkhSxvR3Fv9BNoicC3/BtC0xtU6jw/qIv+jjz2lTlFSUMXkL7OM4OmHR/PHkDg=="
8+
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
79
<script src="exceljs.js"></script>
810
<script>
911
function go() {

spec/manual/public/index.min.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Browserify</title>
6-
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
6+
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"
7+
integrity="sha512-vDTLyifjBBdmGeJrJMO7w+qbbk+7uyoKsUxkhgxPtn3YShSVspezU0EXf780txBgNXzfKkEt7a3RhLs7NmInJQ=="
8+
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
79
<script src="exceljs.min.js"></script>
810
<script>
911
function go() {

0 commit comments

Comments
 (0)