-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new Security service, that can be overridden, add some doc about …
…new Security service, fix security issue on scheme for cert html tag attributes, fix UTF8 example
- Loading branch information
Showing
10 changed files
with
290 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Security | ||
|
||
[back](./README.md) | ||
|
||
Html2Pdf is using the default [Security](../src/Security/Security.php) service to protect the external included files (CSS, images, ...). | ||
|
||
It allows : | ||
|
||
* HTTP/HTTPS external files | ||
* Local Files | ||
|
||
It does **not** protect again **Blind SSRF**. This means that the library loads external resources | ||
without validating the destination address before sending an HTTP request. | ||
|
||
This is not the responsibility of this library. | ||
|
||
You must ensure that the HTML you want to convert is secure, **especially if it is generated from uncontrolled data contributed by users**. | ||
In such cases, an attacker could send requests to both external servers and restricted-access servers (e.g., within a local network). | ||
|
||
If you need additional security, you can implement the [SecurityInterface](../src/Security/SecurityInterface.php), | ||
and call the method `setSecurityService` on the Html2Pdf object to use it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
Sentences that contain all letters commonly used in a language | ||
-------------------------------------------------------------- | ||
|
||
This file is UTF-8 encoded. | ||
|
||
Czech (cz) | ||
--------- | ||
|
||
Příšerně žluťoučký kůň úpěl ďábelské ódy. | ||
Hleď, toť přízračný kůň v mátožné póze šíleně úpí. | ||
Zvlášť zákeřný učeň s ďolíčky běží podél zóny úlů. | ||
Loď čeří kýlem tůň obzvlášť v Grónské úžině. | ||
Ó, náhlý déšť již zvířil prach a čilá laň teď běží s houfcem gazel k úkrytům. | ||
|
||
Danish (da) | ||
--------- | ||
|
||
Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen | ||
Wolther spillede på xylofon. | ||
(= Quiz contestants were eating strawbery with cream while Wolther | ||
the circus clown played on xylophone.) | ||
|
||
German (de) | ||
----------- | ||
|
||
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg | ||
(= Wrongful practicing of xylophone music tortures every larger dwarf) | ||
|
||
Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich | ||
(= Twelve boxing fighters hunted Eva across the dike of Sylt) | ||
|
||
Heizölrückstoßabdämpfung | ||
(= fuel oil recoil absorber) | ||
(jqvwxy missing, but all non-ASCII letters in one word) | ||
|
||
English (en) | ||
------------ | ||
|
||
The quick brown fox jumps over the lazy dog | ||
|
||
Spanish (es) | ||
------------ | ||
|
||
El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y | ||
frío, añoraba a su querido cachorro. | ||
(Contains every letter and every accent, but not every combination | ||
of vowel + acute.) | ||
|
||
French (fr) | ||
----------- | ||
|
||
Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à | ||
côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce | ||
qui lui permet de penser à la cænogenèse de l'être dont il est question | ||
dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, | ||
pense-t-il, diminue çà et là la qualité de son œuvre. | ||
|
||
l'île exiguë | ||
Où l'obèse jury mûr | ||
Fête l'haï volapük, | ||
Âne ex aéquo au whist, | ||
Ôtez ce vœu déçu. | ||
|
||
Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en | ||
canoë au delà des îles, près du mälström où brûlent les novæ. | ||
|
||
Irish Gaelic (ga) | ||
----------------- | ||
|
||
D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh | ||
|
||
Hungarian (hu) | ||
-------------- | ||
|
||
Árvíztűrő tükörfúrógép | ||
(= flood-proof mirror-drilling machine, only all non-ASCII letters) | ||
|
||
Icelandic (is) | ||
-------------- | ||
|
||
Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa | ||
|
||
Sævör grét áðan því úlpan var ónýt | ||
(some ASCII letters missing) | ||
|
||
Greek (el) | ||
------------- | ||
|
||
Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ στὸ χρυσαφὶ ξέφωτο | ||
(= No more shall I see acacias or myrtles in the golden clearing) | ||
|
||
Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία | ||
(= I uncover the soul-destroying abhorrence) | ||
|
||
Hebrew (iw) | ||
----------- | ||
|
||
? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה | ||
|
||
Polish (pl) | ||
----------- | ||
|
||
Pchnąć w tę łódź jeża lub osiem skrzyń fig | ||
(= To push a hedgehog or eight bins of figs in this boat) | ||
|
||
Zażółć gęślą jaźń | ||
|
||
Russian (ru) | ||
------------ | ||
|
||
В чащах юга жил бы цитрус? Да, но фальшивый экземпляр! | ||
(= Would a citrus live in the bushes of south? Yes, but only a fake one!) | ||
|
||
Thai (th) | ||
--------- | ||
|
||
[--------------------------|------------------------] | ||
๏ เป็นมนุษย์สุดประเสริฐเลิศคุณค่า กว่าบรรดาฝูงสัตว์เดรัจฉาน | ||
จงฝ่าฟันพัฒนาวิชาการ อย่าล้างผลาญฤๅเข่นฆ่าบีฑาใคร | ||
ไม่ถือโทษโกรธแช่งซัดฮึดฮัดด่า หัดอภัยเหมือนกีฬาอัชฌาสัย | ||
ปฏิบัติประพฤติกฎกำหนดใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ | ||
|
||
[The copyright for the Thai example is owned by The Computer | ||
Association of Thailand under the Royal Patronage of His Majesty the | ||
King.] | ||
|
||
Example is coming from https://github.com/tecnickcom/TCPDF/blob/main/examples/data/utf8test.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.