当前位置:网站首页>[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 .
边栏推荐
- tars源码分析之4
- Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
- Download address of the official website of national economic industry classification gb/t 4754-2017
- 《国民经济行业分类GB/T 4754—2017》官网下载地址
- Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
- Since DMS is upgraded to a new version, my previous SQL is in the old version of DMS. In this case, how can I retrieve my previous SQL?
- How to input single quotation marks and double quotation marks in latex?
- selenium IDE插件下载安装使用教程
- BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
- Data double write consistency between redis and MySQL
猜你喜欢

期末周,我裂开

Master-slave replication principle of MySQL database

How notepad++ counts words
![[MySQL transaction]](/img/4f/dbfa1bf999cfcbbe8f3b27bb1e932b.jpg)
[MySQL transaction]

电脑通过Putty远程连接树莓派

Deep profile data leakage prevention scheme

两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙

Responsive - media query

大厂技术专家:架构设计中常用的思维模型

A new understanding of how to encrypt industrial computers: host reinforcement application
随机推荐
How can the old version of commonly used SQL be migrated to the new version?
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
【FPGA教程案例7】基于verilog的计数器设计与实现
请问旧版的的常用SQL怎么迁移到新版本里来?
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Analysis of tars source code 5
If there are two sources in the same job, it will be reported that one of the databases cannot be found. Is there a boss to answer
[Mori city] random talk on GIS data (I)
在已经知道表格列勾选一个显示一列
win10微软拼音输入法输入文字时候下方不出现中文提示
Tar source code analysis 8
Set JTAG fuc invalid to normal IO port
How does the inner roll break?
the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
Code rant: from hard coding to configurable, rule engine, low code DSL complexity clock
Status of the thread
Selenium driver ie common problem solving message: currently focused window has been closed
A new understanding of how to encrypt industrial computers: host reinforcement application
Adaptive spatiotemporal fusion of multi-target networks for compressed video perception enhancement
Novel website program source code that can be automatically collected
