July 11, 2023, 10:29 a.m. | jmau111⚡⚡⚡

DEV Community dev.to

Functions, objects, or some configs can contain credentials and sensitive data. There could be multiple occurrences in your code.


Using the SensitiveParameter attribute will prevent any unwanted disclosure in stack traces (e.g., debug_print_backtrace), error logs, and, more generally, in fatal errors.





Basic syntax



function getData(#[\SensitiveParameter] string $password) {}


Instead of the actual value, people will get a SensitiveParameterValue in debugs and other var_dump. Behind the scene, it encapsulates the real value in a private value.


The …

basic beginners code credentials data disclosure error errors function functions logs password people php programming security sensitive data stack traces value

Social Engineer For Reverse Engineering Exploit Study

@ Independent study | Remote

SITEC- Systems Security Administrator- Camp HM Smith

@ Peraton | Camp H.M. Smith, HI, United States

Cyberspace Intelligence Analyst

@ Peraton | Fort Meade, MD, United States

General Manager, Cybersecurity, Google Public Sector

@ Google | Virginia, USA; United States

Cyber Security Advisor

@ H&M Group | Stockholm, Sweden

Engineering Team Manager – Security Controls

@ H&M Group | Stockholm, Sweden