Skip to content

Commit 671e75f

Browse files
committed
Merge branch 'develop' into devsecops
2 parents b4d8da1 + 32a29e8 commit 671e75f

File tree

89 files changed

+3238
-975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3238
-975
lines changed

SECURITY.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# iText Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
We are committed to maintaining the security of our software. If you discover a security vulnerability, we encourage you to report it to us as soon as possible.
6+
7+
To report a vulnerability, please visit our [Vulnerability Reporting Page](https://itextpdf.com/report-vulnerability), or email [vulnerability@apryse.com](vulnerability@apryse.com). If you do not receive a response in 2 business days, please follow up as we may not have received your message.
8+
9+
We follow the procedure of Coordinated Vulnerability Disclosure (CVD) and, to protect the ecosystem, we request that those reporting do the same. Please visit the above page for more information, and follow the steps below to ensure that your report is handled promptly and appropriately:
10+
11+
1. **Do not disclose the vulnerability publicly** until we have had a chance to address it.
12+
2. **Provide a detailed description** of the vulnerability, including steps to reproduce it, if possible.
13+
3. **Include any relevant information** such as the version of iText Core you are using, your operating system, and any other pertinent details.
14+
15+
## Security Updates and Patches
16+
17+
When a vulnerability is reported, we will:
18+
19+
1. **Investigate and verify** the vulnerability.
20+
2. **Develop and test** a fix for the vulnerability.
21+
3. **Release a patch** as soon as possible.
22+
23+
24+
## Known Vulnerabilities
25+
26+
The iText Knowledge Base has a page for known [Common Vulnerabilities and Exposures](https://kb.itextpdf.com/itext/cves) (CVEs), please check it to ensure your vulnerability has not already been disclosed or addressed.
27+
28+
## Supported product lines
29+
30+
See [Compatibility Matrix](https://kb.itextpdf.com/itext/compatibility-matrix)
31+
32+
## Security Best Practices
33+
34+
To help ensure the security of your applications using iText Core, we recommend the following best practices:
35+
36+
1. **Keep iText Core up to date** by regularly checking for and applying updates.
37+
2. **Review and follow** our security guidelines for secure usage.
38+
3. **Monitor your applications** for any unusual activity and investigate any anomalies promptly.
39+
40+
Thank you for helping us keep iText secure!

itext.tests/itext.io.tests/itext/io/font/CFFFontSubsetIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public virtual void SubsetNonCidCFFFontRangeCheck() {
104104
CFFFont result = new CFFFont(cffSubsetBytes);
105105
int expectedCharsetLength = 255;
106106
// skip over the format ID (1 byte) and the first SID (2 bytes)
107-
result.Seek(result.fonts[0].charsetOffset + 3);
107+
result.Seek(result.fonts[0].GetCharsetOffset() + 3);
108108
NUnit.Framework.Assert.AreEqual(expectedCharsetLength - 2, result.GetCard16());
109109
}
110110

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2024 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using iText.Test;
24+
25+
namespace iText.IO.Font.Cmap {
26+
[NUnit.Framework.Category("UnitTest")]
27+
public class CMapToUnicodeTest : ExtendedITextTest {
28+
[NUnit.Framework.Test]
29+
public virtual void EmptyCmapVarTest() {
30+
NUnit.Framework.Assert.IsNotNull(CMapToUnicode.EMPTY_CMAP);
31+
NUnit.Framework.Assert.IsFalse(CMapToUnicode.EMPTY_CMAP.HasByteMappings(), "Cmap has no two byte mappings"
32+
);
33+
}
34+
}
35+
}

itext.tests/itext.io.tests/itext/io/font/otf/ActualTextIteratorTest.cs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,50 @@ public virtual void TestActualTestParts() {
3434
ActualTextIterator actualTextIterator = new ActualTextIterator(glyphLine);
3535
GlyphLine.GlyphLinePart part = actualTextIterator.Next();
3636
// When actual text is the same as the result by text extraction, we should omit redundant actual text in the content stream
37-
NUnit.Framework.Assert.IsNull(part.actualText);
37+
NUnit.Framework.Assert.IsNull(part.GetActualText());
38+
}
39+
40+
[NUnit.Framework.Test]
41+
public virtual void NextCurrentResNullTest() {
42+
Glyph glyph = new Glyph(200, 200, '\u002d');
43+
GlyphLine glyphLine = new GlyphLine(JavaUtil.ArraysAsList(glyph, null, glyph));
44+
glyphLine.SetActualText(0, 1, "\u002d");
45+
ActualTextIterator actualTextIterator = new ActualTextIterator(glyphLine);
46+
actualTextIterator.Next();
47+
GlyphLine.GlyphLinePart secondNext = actualTextIterator.Next();
48+
NUnit.Framework.Assert.IsNull(secondNext);
49+
}
50+
51+
[NUnit.Framework.Test]
52+
public virtual void NextIterationTest() {
53+
Glyph glyph = new Glyph(200, 200, '\u002d');
54+
GlyphLine glyphLine = new GlyphLine(JavaUtil.ArraysAsList(glyph, glyph, glyph));
55+
glyphLine.SetActualText(0, 1, "\u002d");
56+
ActualTextIterator actualTextIterator = new ActualTextIterator(glyphLine);
57+
GlyphLine.GlyphLinePart next = actualTextIterator.Next();
58+
NUnit.Framework.Assert.AreEqual(3, next.GetEnd());
59+
}
60+
61+
[NUnit.Framework.Test]
62+
public virtual void NextWithNegativeEndTest() {
63+
Glyph glyph = new Glyph(200, 200, '\u002d');
64+
GlyphLine glyphLine = new GlyphLine(JavaUtil.ArraysAsList(glyph, glyph, glyph));
65+
glyphLine.SetActualText(0, 1, "\u002d");
66+
glyphLine.SetEnd(-1);
67+
ActualTextIterator actualTextIterator = new ActualTextIterator(glyphLine);
68+
GlyphLine.GlyphLinePart next = actualTextIterator.Next();
69+
NUnit.Framework.Assert.IsNull(next);
70+
}
71+
72+
[NUnit.Framework.Test]
73+
public virtual void NextWithInvalidUnicodeTest() {
74+
Glyph glyph = new Glyph(200, 200, 0);
75+
Glyph glyphinvalid = new Glyph(200, 200, null);
76+
GlyphLine glyphLine = new GlyphLine(JavaUtil.ArraysAsList(glyph, glyphinvalid));
77+
glyphLine.SetActualText(1, 2, "X");
78+
ActualTextIterator actualTextIterator = new ActualTextIterator(glyphLine);
79+
GlyphLine.GlyphLinePart next = actualTextIterator.Next();
80+
NUnit.Framework.Assert.IsNull(next.GetActualText());
3881
}
3982
}
4083
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2024 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using iText.Test;
24+
25+
namespace iText.IO.Font.Otf {
26+
[NUnit.Framework.Category("UnitTest")]
27+
public class GlyphLinePartTest : ExtendedITextTest {
28+
[NUnit.Framework.Test]
29+
public virtual void CustomGlyphLinePartTest() {
30+
GlyphLine.GlyphLinePart part = new GlyphLine.GlyphLinePart(0, 4);
31+
part.SetStart(1);
32+
part.SetEnd(5);
33+
part.SetReversed(false);
34+
NUnit.Framework.Assert.AreEqual(1, part.GetStart());
35+
NUnit.Framework.Assert.AreEqual(5, part.GetEnd());
36+
NUnit.Framework.Assert.IsFalse(part.IsReversed());
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)