Prototype pollution
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, python
Direzione di ricerca
Start with the org.transcrypt.runtime.js module and inspect the prototype helper definitions for Array, String, Uint8Array, and the other affected built-ins. Use the provided for-in example after importing a Transcrypt module to verify the helpers are no longer enumerable, then check that the reported helper functionality still works.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
After importing a transcrypt module, various prototypes such as Array, String, Uint8Array are polluted with python specific helper functions. These appear to be coming from the org.transcrypt.runtime.js module such as
Array.prototype.extend = function (aList) {
this.push.apply (this, aList);
};
Unfortunately these functions are listed as enumerable resulting in unexpected behaviour in external code ran later when its iterating even when the array wasn't created in the python code. Executing the following in the js console after simply importing the module
for( v in []){
console.log(v)
}
results in all these items being output
_class__
__iter__
__getslice__
__setslice__
__repr__
__str__
append
py_clear
extend
insert
remove
index
py_pop
py_sort
__add__
__mul__
__rmul__
__bindexOf__
add
discard
isdisjoint
issuperset
issubset
union
intersection
difference
symmetric_difference
py_update
__eq__
__ne__
__le__
__ge__
__lt__
__gt__
Changing it to be defined as the following appears to resolve the issue and doesn't appear to impact the functionality in my test case
Object.defineProperty(Array.prototype, 'extend', {
value: function (aList) {
this.push.apply (this, aList);
},
enumerable: false,
writable: true
})
- Lingua principale
- Python
- Stelle
- 2.9k
- Fork
- 218
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TranscryptOrg/Transcrypt
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TranscryptOrg/Transcrypt#913 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
TranscryptOrg/Transcrypt#911 · 2 commenti ·
-
IS: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
TranscryptOrg/Transcrypt#908 ·
-
SUB: documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
TranscryptOrg/Transcrypt#656 · 7 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
TranscryptOrg/Transcrypt#914 ·
Tutte le issue di TranscryptOrg/Transcrypt
Issue simili
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Apertaarea: ci bug perceived difficulty: 3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ClickHouse/clickhouse-connect#1057 ·