Skip to content

Commit cacb5a3

Browse files
committed
otp: add bidi scanner
addition of bidi scanner and fix of invisible unicode from when Erlang/OTP translated XML to markdown.
1 parent 9d78ea3 commit cacb5a3

5 files changed

Lines changed: 202 additions & 149 deletions

File tree

.github/workflows/main.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,34 @@ jobs:
8989
exit 1
9090
fi
9191
92+
semgrep:
93+
name: Semgrep Scan
94+
runs-on: ubuntu-latest
95+
permissions:
96+
contents: read
97+
security-events: write
98+
99+
container:
100+
image: semgrep/semgrep@sha256:a3d49dc967b8534a6a76628e50c51cbfe33eb7195dc2feab1fdc0f100852c8ef
101+
102+
steps:
103+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104+
- name: Run Semgrep
105+
env:
106+
SEMGREP_SEND_METRICS: off
107+
run: |
108+
semgrep \
109+
--config ".semgrep/" \
110+
--error \
111+
--sarif \
112+
--output semgrep.sarif
113+
114+
- name: Upload SARIF to GitHub Security tab
115+
uses: github/codeql-action/upload-sarif@v3
116+
with:
117+
sarif_file: semgrep.sarif
118+
if: always()
119+
92120
pack:
93121
name: Build Erlang/OTP (64-bit)
94122
runs-on: ubuntu-latest

.semgrep/bidi-unicode.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
rules:
2+
- id: bidi-invisible-unicode
3+
patterns:
4+
- pattern-regex: "[\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u00AD]"
5+
message: >
6+
Dangerous bidirectional or invisible Unicode character detected in $PATH.
7+
This may indicate a Trojan Source attack (CVE-2021-42574).
8+
Remove or replace the character.
9+
languages:
10+
- generic
11+
severity: ERROR
12+
metadata:
13+
category: security
14+
cwe: "CWE-116"
15+
references:
16+
- https://trojansource.codes

.semgrepignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.semgrep/
2+
lib/stdlib/uc_spec/
3+
lib/stdlib/test/io_proto_SUITE_data/external_utf8_bom.dat
4+
lib/stdlib/test/io_proto_SUITE_data/testdata_utf8_bom.dat
5+
lib/kernel/test/interactive_shell_SUITE.erl
6+
lib/stdlib/test/json_SUITE_data/i_structure_UTF-8_BOM_empty_object.json
7+
lib/stdlib/test/json_SUITE_data/n_structure_UTF8_BOM_no_data.json
8+
lib/stdlib/test/re_SUITE_data/testoutput4
9+
semgrep.sarif

erts/doc/references/erlc_cmd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ of situations that force a restart:
257257
[compile server](erlc_cmd.md#compile_server) by the given name, allowing a
258258
single user to run multiple unrelated builds in parallel without them
259259
affecting each other, which can be useful for shared build machines and the
260-
like. The name must be alpha­numeric, and it defaults to being empty.
260+
like. The name must be alpha-numeric, and it defaults to being empty.
261261

262262
## See Also
263263

0 commit comments

Comments
 (0)