Browse Source

Merge pull request #41 from syzoj/unzip

Use modified unzip to prevent zip symlink attack
pull/6/head
Menci 6 years ago committed by GitHub
parent
commit
ae66b4078e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      bin/unzip
  2. 3
      models/problem.js
  3. 36
      static/style.css

BIN
bin/unzip

Binary file not shown.

3
models/problem.js

@ -340,7 +340,8 @@ class Problem extends Model {
await fs.remove(dir);
await fs.ensureDir(dir);
await p7zip.extract(path, dir);
let execFileAsync = Promise.promisify(require('child_process').execFile);
await execFileAsync(__dirname + '/../bin/unzip', ['-j', '-o', '-d', dir, path]);
await fs.move(path, this.getTestdataArchivePath(), { overwrite: true });
});
}

36
static/style.css

@ -35,6 +35,42 @@ body
sans-serif;
}
.ui.header,
.ui.button,
.ui.input input,
.ui.menu,
.ui.form input:not([type]),
.ui.form input[type=date],
.ui.form input[type=datetime-local],
.ui.form input[type=email],
.ui.form input[type=file],
.ui.form input[type=number],
.ui.form input[type=password],
.ui.form input[type=search],
.ui.form input[type=tel],
.ui.form input[type=text],
.ui.form input[type=time],
.ui.form input[type=url],
h1,
h2,
h3,
h4,
h5,
body
{
font-family:
-apple-system,
'PingFang SC',/* Apple */
'Source Han Sans SC',
'Noto Sans CJK SC', /* Google */
'Microsoft Yahei',
'Lantinghei SC',
'Hiragino Sans GB',
'Microsoft Sans Serif', /* M$ */
'WenQuanYi Micro Hei', /* *nix */
sans-serif;
}
.font-content {
font-family: 'Open Sans', 'Source Han Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
}

Loading…
Cancel
Save