当前位置:网站首页>[web security] nodejs prototype chain pollution analysis
[web security] nodejs prototype chain pollution analysis
2022-07-04 07:10:00 【qq_ forty-three million four hundred and seventy-nine thousand 】
Python Wechat ordering applet course video
https://edu.csdn.net/course/detail/36074
Python Actual quantitative transaction financial management system
https://edu.csdn.net/course/detail/35475
Nodejs Prototype chain pollution analysis
What is? js Prototype ?
Can be js Prototype is understood as other OOP Class in language , But there are still subtle differences .
1. function F(){...}
2. var f = new F();
analysis :
1. Create a func F, At the same time, he created a F object ( This object defaults to next Object Prototype chain of , It can be understood as Object Instance object of ), And will F The constructor of points to function F(), At the same time, set internal properties prototype Point to the object F In itself .
2. When it comes to objects F Or function F When instantiating , Will create An instance object , At the same time, the instance object adds one by default __proto__ attribute , Point to F object .
What is? js Prototype chain ?
I see js Prototype , that js The prototype chain should be very clear ...( The dog's head lives : After all, it is impossible to tell the truth “ The prototype chain is the chain composed of prototypes !”
Prototype chain pollution is something ?
Think first :foo.__proto__ Pointing to Foo Class prototype. that , If we modify foo.__proto__ The value in , Is it possible to modify Foo Class? ?
Pictured , Create an object first a, And instantiate and assign to test1. Create another b object , hold test1 Of __proto__ Point to b object . But there seems to be no change ??? Prototype chain pollution is fake ?
see test1 The prototype of the , It has indeed become b ah , Why not b Properties of y Well ? In fact, this function is equivalent to a constructor , Inside this.y Only in its corresponding instantiated object . Change the chain directly , But this function did not execute , That is why the final display does not y attribute , As long as y Properties adding to b In the object
Pictured , stay b Add a... To the prototype object z attribute ,test1 This attribute can be used in , So as to achieve the purpose of polluting the prototype chain .
How to use prototype chain pollution ?
In the final analysis, it is because of the modification __proto__ Attribute changes the prototype chain of the instance object . So we can see which operations will be modified __proto__ attribute , Generally, the operation attribute can also be in the form of array , Such as : test1[‘proto’] = xxx. Therefore, the most likely cause of prototype chain pollution is inseparable from the functions that operate the array .
There are merge,clone Such as function
Prototype chain pollution in ctf Use of
https://blog.happysec.cn/index/view/328.html
Reference resources P Divine masterpiece
Summary
- js Data analysis of prototype chain
- express Framework support according to Content-Type To parse the request Body, So it can be set conveniently payload
__EOF__
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-ZSs8vR6i-1644790257071)(https://blog.csdn.net/Aurora-M)]Aur0ra - Link to this article :https://blog.csdn.net/Aurora-M/p/15890253.html
- About bloggers : Comments and private messages will be answered as soon as possible . perhaps Direct personal trust I .
- Copyright notice : All articles in this blog except special statement , All adopt BY-NC-SA license agreement . Reprint please indicate the source !
- Solidarity bloggers : If you think the article will help you , You can click the bottom right corner of the article **【[ recommend ](javascript:void(0)】** once .
边栏推荐
- 《国民经济行业分类GB/T 4754—2017》官网下载地址
- win10微软拼音输入法输入文字时候下方不出现中文提示
- 期末周,我裂开
- 由于dms升级为了新版,我之前的sql在老版本的dms中,这种情况下,如何找回我之前的sql呢?
- Highly paid programmers & interview questions: how does redis of series 119 realize distributed locks?
- Mobile adaptation: vw/vh
- Cell reports: Wei Fuwen group of the Institute of zoology, Chinese Academy of Sciences analyzes the function of seasonal changes in the intestinal flora of giant pandas
- Adaptive spatiotemporal fusion of multi-target networks for compressed video perception enhancement
- Tar source code analysis 8
- MySQL 45 lecture learning notes (XIV) count (*)
猜你喜欢
What is the use of cloud redis? How to use cloud redis?
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
About how idea sets up shortcut key sets
Selenium driver ie common problem solving message: currently focused window has been closed
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions
Flink memory model, network buffer, memory tuning, troubleshooting
提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
[GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph
【网络数据传输】基于FPGA的百兆网/兆网千UDP数据包收发系统开发,PC到FPGA
随机推荐
Tar source code analysis Part 3
[Valentine's day] - you can change your love and write down your lover's name
Tar source code analysis 9
抽奖系统测试报告
高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
js 常用时间处理函数
NLP-文献阅读总结
About how idea sets up shortcut key sets
Computer connects raspberry pie remotely through putty
What is the use of cloud redis? How to use cloud redis?
2022 is probably the best year for the economy in the next 10 years. Did you graduate in 2022? What is the plan after graduation?
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
Vulhub vulnerability recurrence 77_ zabbix
Mysql 45讲学习笔记(十二)MySQL会“抖”一下
请问旧版的的常用SQL怎么迁移到新版本里来?
the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
Deep profile data leakage prevention scheme
Download address of the official website of national economic industry classification gb/t 4754-2017
Centos8 install mysql 7 unable to start up
Lottery system test report