Skip to content

Commit baaa7a4

Browse files
authored
Merge pull request #187 : Add Java security libraries
2 parents 9adf327 + b643b23 commit baaa7a4

File tree

18 files changed

+113
-26
lines changed

18 files changed

+113
-26
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ updates:
1212
patterns:
1313
- "*"
1414
update-types:
15-
- "minor"
1615
- "patch"
16+
- "minor"
1717
security-update:
1818
applies-to: security-updates
1919
patterns:

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v6.0.2
2424

2525
- name: Link Checker
26-
uses: lycheeverse/lychee-action@v2.7.0
26+
uses: lycheeverse/lychee-action@v2.8.0
2727
with:
2828
args: >-
2929
--no-progress
@@ -73,7 +73,7 @@ jobs:
7373
# rojopolis/spellcheck-github-actions does not support PT-BR,
7474
# only PT, and PT-BR is too different to pass a PT spellcheck
7575
- name: Set up Python for PT-BR
76-
uses: actions/setup-python@v6.1.0
76+
uses: actions/setup-python@v6.2.0
7777
with:
7878
python-version: '3.10'
7979

@@ -96,7 +96,7 @@ jobs:
9696
uses: actions/checkout@v6.0.2
9797

9898
- name: Install python
99-
uses: actions/setup-python@v6.1.0
99+
uses: actions/setup-python@v6.2.0
100100
with:
101101
python-version: 3.x
102102

@@ -130,7 +130,7 @@ jobs:
130130
uses: actions/checkout@v6.0.2
131131

132132
- name: Install python
133-
uses: actions/setup-python@v6.1.0
133+
uses: actions/setup-python@v6.2.0
134134
with:
135135
python-version: 3.x
136136

.github/workflows/housekeeping.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
keep_minimum_runs: 10
2626

2727
- name: Delete unused workflows
28-
uses: otto-de/purge-deprecated-workflow-runs@v4.0.2
28+
uses: otto-de/purge-deprecated-workflow-runs@v4.0.3
2929
with:
3030
token: ${{ github.token }}
3131

@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/checkout@v6.0.2
3838

3939
- name: Link Checker
40-
uses: lycheeverse/lychee-action@v2.7.0
40+
uses: lycheeverse/lychee-action@v2.8.0
4141
with:
4242
# skip the jekyll files under '_includes' directory, check all other directories
4343
args: >-
@@ -61,7 +61,7 @@ jobs:
6161

6262
steps:
6363
- name: Tidy stale PRs and issues
64-
uses: actions/stale@v10.1.1
64+
uses: actions/stale@v10.2.0
6565
with:
6666
days-before-issue-stale: 183
6767
days-before-issue-close: -1

.github/workflows/pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v6.0.2
1717

1818
- name: Link Checker
19-
uses: lycheeverse/lychee-action@v2.7.0
19+
uses: lycheeverse/lychee-action@v2.8.0
2020
with:
2121
args: >-
2222
--exclude 'github\.com/OWASP/DevGuide/blob/main/docs'
@@ -81,7 +81,7 @@ jobs:
8181
# rojopolis/spellcheck-github-actions does not support PT-BR,
8282
# only PT, and PT-BR is too different to pass a PT spellcheck
8383
- name: Set up Python
84-
uses: actions/setup-python@v6.1.0
84+
uses: actions/setup-python@v6.2.0
8585
with:
8686
python-version: '3.10'
8787

@@ -104,7 +104,7 @@ jobs:
104104
uses: actions/checkout@v6.0.2
105105

106106
- name: Install python
107-
uses: actions/setup-python@v6.1.0
107+
uses: actions/setup-python@v6.2.0
108108
with:
109109
python-version: 3.x
110110

@@ -135,7 +135,7 @@ jobs:
135135
uses: actions/checkout@v6.0.2
136136

137137
- name: Install python
138-
uses: actions/setup-python@v6.1.0
138+
uses: actions/setup-python@v6.2.0
139139
with:
140140
python-version: 3.x
141141

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/checkout@v6.0.2
1919

2020
- name: Install python
21-
uses: actions/setup-python@v6.1.0
21+
uses: actions/setup-python@v6.2.0
2222
with:
2323
python-version: 3.x
2424

.wordlist-en.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ LINNDUN
162162
LLM
163163
LSMs
164164
Laravel
165+
LevelBlue
165166
Lezza
166167
LifeCycle
167168
Lifecycle

.wordlist-es.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ leaks
263263
learning
264264
left
265265
Left
266+
LevelBlue
266267
LFD
267268
library
268269
LINDDUN

docs/en/04-design/01-threat-modeling/01-threat-modeling-project.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
The [Threat Model Project][tmproject] is an over-arching project provided by OWASP
1+
The OWASP [Threat Modeling Project][tmproject] is an over-arching project
22
that seeks to inform and guide on the very large domain that is [Threat Modeling][tmptm].
33

44
#### What is the Threat Model project?
55

66
The Threat Model project is not intended to be a primary source on the threat modeling domain;
77
there are already many excellent sources that describe and explain threat modeling that this project does not need to repeat.
88

9-
Instead the Threat Model project seeks to provide information on [threat modeling techniques][tmpapp]
9+
Instead the Threat Model project seeks to provide direction on [threat modeling techniques][tmpapp]
1010
for applications and systems of all types, with a focus on current and emerging techniques.
11+
To provide this the project intends to collate threat modeling techniques, methodologies, tools and examples.
1112

12-
To do this project intends to gather techniques, methodologies, tools and examples.
13-
There is also the intention to foster a threat modeling community and support it through initiatives and forums.
13+
There is also the aim to foster a threat modeling community and support it through initiatives and forums.
1414

15-
Note that much of this is what the project intends to provide in the future.
16-
As of January 2026 the project is going through a change process that will better provide this information and guidance.
15+
Note that much of this are intentions for the future;
16+
as of January 2026 the project is going through a change process that will better provide this information and guidance.
17+
At present it is at OWASP Incubator status with promotion to Laboratory status expected later in 2026.
1718

1819
#### Why refer to this project?
1920

2021
The [Threat Modeling][tmproject] project is an over-arching project for the other threat modeling projects and resources.
2122

2223
It can be used as a landing page for all things threat modeling;
2324
the starting point for finding [resources and tools][tmpres] as well as the core concepts.
24-
For example there is an introduction to Shostack's [Four Question Framework][4QFW],
25-
that then references the primary source if the user needs to know more.
25+
For example there is an introduction to Shostack's [Four Question Framework][4QFW]
26+
that references the primary source if the user needs to know more.
2627

2728
#### OWASP threat modeling projects
2829

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
The OWASP [Java Encoder][java-encoder-project] and OWASP [Java HTML Sanitizer][html-sanitizer-project] projects
2+
are security libraries for Java web applications that provide output encoding and HTML input sanitization.
3+
4+
The OWASP [JSON Sanitizer][json-sanitizer] Java library is used to ensure both JSON input and output
5+
are _reasonably_ safe for Java applications.
6+
7+
#### What are they?
8+
9+
Java Encoder package provides the Java application with contextual output encoding of HTML.
10+
It provides individual methods for HTML, URLs, JavaScript and CSS.
11+
12+
Java HTML Sanitizer is used to sanitize untrusted HTML so that it can be safely handled within a Java application.
13+
The JAR file is included in a Java application and then a policy is defined for it.
14+
15+
These are both established projects with a regular release history stretching back to 2013.
16+
17+
The JSON Sanitizer is a Java component that will transform arbitrary JSON
18+
to well-formed JSON as defined by [RFC 4627][rfc4627].
19+
This can be used to accept JSON input from an untrusted source and then safely output JSON to other processes.
20+
21+
JSON Sanitizer is a widely used library provided by OWASP,
22+
and it is a direct dependents for many 1000s of other libraries and in many more applications.
23+
It is a project that was transferred to OWASP in 2021 by github user `mikesamuel`
24+
and so this OWASP library is identified as `com.mikesamuel:json-sanitizer`.
25+
26+
#### Why use the libraries?
27+
28+
The use of both Java Encoder and Java HTML Sanitizer is part of a defense in depth approach
29+
to preventing [cross site scripting][csxss] (XSS) and other attacks.
30+
They are well established OWASP projects with 'Lab' status.
31+
32+
The OWASP [JSON Sanitizer][json-sanitizer] Java library is widely used,
33+
for example it is a direct dependency for literally [1000s of Java components][json-sanitizer-dependents],
34+
and should be considered for JSON specific output normalization and input validation.
35+
It is less well supported than the Java Encoder or Java HTML Sanitizer, version 1.2.2 was released in January 2021,
36+
but it is still stable and (really) useful.
37+
38+
#### How to use the libraries
39+
40+
Include the Java Encoder package into a Java application [via Maven][java-encoder].
41+
The '[How to Use the OWASP Java Encoder][java-encoder-usage]' documentation explains how to use it in various contexts,
42+
such as HTML, URLs, JavaScript and CSS.
43+
44+
Follow the [examples][html-sanitizer-examples] provided by Java HTML Sanitizer
45+
to include the utility and configure it with policy.
46+
47+
The JSON Sanitizer JAR file can be fetched from Maven Central, follow the [Getting Started][json-sanitizer-usage] guide:
48+
49+
```text
50+
import com.google.json.JsonSanitizer;
51+
String wellFormedJson = JsonSanitizer.sanitize(myJsonLikeString);
52+
```
53+
54+
#### References
55+
56+
* OWASP [Cross Site Scripting prevention][csxss] Cheatsheet
57+
* OWASP [Java Encoder][java-encoder-github]
58+
* OWASP [Java HTML Sanitizer][html-sanitizer]
59+
* OWASP [JSON Sanitizer][json-sanitizer]
60+
61+
----
62+
63+
The OWASP Developer Guide is a community effort; if there is something that needs changing
64+
then [submit an issue][issue050304] or [edit on GitHub][edit050304].
65+
66+
[csxss]: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet
67+
[edit050304]: https://github.com/OWASP/DevGuide/blob/main/docs/en/05-implementation/03-secure-libraries/04-java-secure-libs.md
68+
[html-sanitizer]: https://github.com/OWASP/java-html-sanitizer/releases/latest/
69+
[html-sanitizer-examples]: https://github.com/OWASP/java-html-sanitizer/tree/main/owasp-java-html-sanitizer/src/main/java/org/owasp/html/examples
70+
[html-sanitizer-project]: https://owasp.org/www-project-java-html-sanitizer/
71+
[issue050304]: https://github.com/OWASP/DevGuide/issues/new?labels=content&template=request.md&title=Update:%2005-implementation/03-secure-libraries/04-java-secure-libs
72+
[java-encoder]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.owasp.encoder%22
73+
[java-encoder-github]: https://github.com/OWASP/owasp-java-encoder/releases/latest/
74+
[java-encoder-project]: https://owasp.org/www-project-java-encoder/
75+
[java-encoder-usage]: https://owasp.org/www-project-java-encoder/#div-use
76+
[json-sanitizer]: https://github.com/OWASP/json-sanitizer/releases/latest/
77+
[json-sanitizer-dependents]: https://central.sonatype.com/artifact/com.mikesamuel/json-sanitizer/dependents
78+
[json-sanitizer-usage]: https://github.com/OWASP/json-sanitizer/blob/master/docs/getting_started.md
79+
[rfc4627]: https://www.ietf.org/rfc/rfc4627.txt

docs/en/06-verification/04-vulnerability-management/01-defectdojo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ then [submit an issue][issue080401] or [edit on GitHub][edit080401].
6565
[defectdojo]: https://defectdojo.com/
6666
[defectdojo-docs]: https://docs.defectdojo.com/
6767
[defectdojo-docker]: https://github.com/DefectDojo/django-DefectDojo/blob/dev/readme-docs/DOCKER.md
68-
[defectdojo-install]: https://docs.defectdojo.com/en/about_defectdojo/new_user_checklist/
68+
[defectdojo-install]: https://docs.defectdojo.com/get_started/about/
6969
[defectdojo-project]: https://owasp.org/www-project-defectdojo/
7070
[defectdojo-tools]: https://defectdojo.com/integrations
7171
[edit080401]: https://github.com/OWASP/DevGuide/blob/main/docs/en/06-verification/04-vulnerability-management/01-defectdojo.md

0 commit comments

Comments
 (0)