Add attribute to shortcode dynamically

Untested (and can’t test right now) but you ought to be able to add attributes with a filter… something like:

function test_sc($atts,$content) {
  // echo 'test_sc';
  $atts = shortcode_atts(
      array(
              'foo' => 'no foo',
              'bar' => 'default bar',
      ), 
      $atts, 
      'testsc' 
  );

  // var_dump($atts);

}
add_shortcode('testsc','test_sc');

function test_shortcode_att_add($atts) {
  # this filter should only run once (first use on page)
  remove_filter('shortcode_atts_testsc','test_shortcode_att_add');
  $atts['xxx'] = 'yyy';
  return $atts;
}
add_filter('shortcode_atts_testsc','test_shortcode_att_add');

Of course, I don’t know exactly what you attribute you are trying to add, or what kind of supporting code it might depend on.